main() File "cls_set.py", line 50, in main output = model(input_var) File "/usr/local/lib64/python3.6/site-packages/torch/nn/modules/module.py", line 532, in __._runtimeer">
赞
踩
- Traceback (most recent call last):
- File "cls_set.py", line 62, in <module>
- main()
- File "cls_set.py", line 50, in main
- output = model(input_var)
- File "/usr/local/lib64/python3.6/site-packages/torch/nn/modules/module.py", line 532, in __call__
- result = self.forward(*input, **kwargs)
- File "/usr/local/lib64/python3.6/site-packages/torchvision/models/alexnet.py", line 45, in forward
- x = self.features(x)
- File "/usr/local/lib64/python3.6/site-packages/torch/nn/modules/module.py", line 532, in __call__
- result = self.forward(*input, **kwargs)
- File "/usr/local/lib64/python3.6/site-packages/torch/nn/modules/container.py", line 100, in forward
- input = module(input)
- File "/usr/local/lib64/python3.6/site-packages/torch/nn/modules/module.py", line 532, in __call__
- result = self.forward(*input, **kwargs)
- File "/usr/local/lib64/python3.6/site-packages/torch/nn/modules/pooling.py", line 141, in forward
- self.return_indices)
- File "/usr/local/lib64/python3.6/site-packages/torch/_jit_internal.py", line 181, in fn
- return if_false(*args, **kwargs)
- File "/usr/local/lib64/python3.6/site-packages/torch/nn/functional.py", line 488, in _max_pool2d
- input, kernel_size, stride, padding, dilation, ceil_mode)
- RuntimeError: Given input size: (256x4x2). Calculated output size: (256x1x0). Output size is too small
原因:图片太小,没有拉伸,进入网络后池化不够大
解决:修改了pooling层(网络结构改错了)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。