THU-MIG / torch-model-compression

针对pytorch模型的自动化模型结构分析和修改工具集,包含自动分析模型结构的模型压缩算法库
MIT License
240 stars 40 forks source link

关于resnet和自建模型prune时遇到的相同报错 #17

Closed EricBlaine007 closed 1 year ago

EricBlaine007 commented 1 year ago

前辈您好,最近学习了您ACNet、ResRep、RepVGG几篇文章,您真的有非凡的创造力!但我使用您在examples中给出的prune.py示例对resnet56和自己模型的压缩中遇到了相同的报错,可以向您请教下吗? (1)对resnet56压缩时的报错如下: Traceback (most recent call last): File "/home3/xxx/torch-model-compression-main/examples/torchslim/pytorch_cifar/prune.py", line 294, in solver.run() File "/home3/xxx/torch-model-compression-main/torchslim/slim_solver.py", line 790, in run self.run_hook(self.iteration_end_hook) File "/home3/xxx/torch-model-compression-main/torchslim/slim_solver.py", line 660, in run_hook function(self) File "/home3/xxx/torch-model-compression-main/torchslim/pruning/resrep.py", line 827, in after_iteration_hook current_graph.build_graph(graph_inputs) File "/home3/xxx/torch-model-compression-main/torchpruner/graph.py", line 622, in build_graph operator_dict[operator].fill_shape() File "/home3/xxx/torch-model-compression-main/torchpruner/operator/operator.py", line 191, in fill_shape

gdh1995 commented 1 year ago

see https://github.com/THU-MIG/torch-model-compression/issues/11#issuecomment-1515049780