lyhue1991/eat_pytorch_in_20_days

1-2,图片数据建模流程范例报错

1723189543 opened this issue · 1 comments

Failed to run summary...
Traceback (most recent call last):
File "D:\Program Files\pytorch'\1-2,图片数据建模流程范例.py", line 66, in
torchkeras.summary(net,input_shape= (3,32,32))
File "D:\Program Files\venv\lib\site-packages\torchkeras\summary.py", line 67, in summary
model(*x) if not (kwargs or args) else model(*x, *args, **kwargs)
File "D:\Program Files\venv\lib\site-packages\torch\nn\modules\module.py", line 1151, in _call_impl
hook_result = hook(self, input, result)
File "D:\Program Files\venv\lib\site-packages\torchkeras\summary.py", line 37, in hook
info["out"] = [batch_size] + list(outputs.size())[1:]
AttributeError: 'NoneType' object has no attribute 'size'
不使用summary后面也会出现AttributeError: 'NoneType' object has no attribute 'size'

我运行了,没问题,我还是运行的自己的模型