examples中prune.py运行报错
chihoz opened this issue · comments
运行到第六个epoch时报错如下:
Traceback (most recent call last):
File "D:\Pycharm\PyCharm 2021.2.3\plugins\python\helpers\pydev\pydevd.py", line 1483, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "D:\Pycharm\PyCharm 2021.2.3\plugins\python\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "E:/python project/torch-model-compression-main/torch-model-compression-main/examples/torchslim/pytorch-cifar/prune.py", line 94, in
solver.run()
File "D:\Anoconda\lib\site-packages\torchpruner-0.1.0-py3.8.egg\torchslim\slim_solver.py", line 354, in run
File "D:\Anoconda\lib\site-packages\torchpruner-0.1.0-py3.8.egg\torchslim\slim_solver.py", line 224, in run_hook
File "D:\Anoconda\lib\site-packages\torchpruner-0.1.0-py3.8.egg\torchslim\pruning\resrep.py", line 297, in after_iteration_hook
File "D:\Anoconda\lib\site-packages\torchpruner-0.1.0-py3.8.egg\torchpruner\graph.py", line 622, in build_graph
File "D:\Anoconda\lib\site-packages\torchpruner-0.1.0-py3.8.egg\torchpruner\operator\operator.py", line 186, in fill_shape
"""
RuntimeError: Fail to predict the shape on operator name: 'self.bn1.BatchNormalization', type: 'BatchNormalization'
是什么原因呢?
我也遇到了这个问题,请问你解决了吗?
我是在window上运行报Fail to predict the shape on operator name: 'self.bn1.BatchNormalization', type: 'BatchNormalization'这个错误,在linux上运行正常。估计是安装包环境问题
我是在window上运行报Fail to predict the shape on operator name: 'self.bn1.BatchNormalization', type: 'BatchNormalization'这个错误,在linux上运行正常。估计是安装包环境问题
我在linux上同样也遇到了这个问题...
我也遇到了这个问题,请问你解决了吗?
请问下您解决了吗
我是在window上运行报Fail to predict the shape on operator name: 'self.bn1.BatchNormalization', type: 'BatchNormalization'这个错误,在linux上运行正常。估计是安装包环境问题
我在linux上同样也遇到了这个问题...
请问下您解决了吗这个问题,我在Linux系统上也遇到了相同的问题。
你们 pytorch 版本太新了,我在 torch==1.9.0+cu111 上测试正常,只是 torch==1.13.1+cu117 就不行了
测试发现是 pytorch 改了 BatchNormalization 的功能,某些时候会增加输出个数,从 1 个增加到 5 个。
Commit 3410752 强行忽略了后几个,应该能跑了。