Open broliao opened 5 years ago
in "models.py" comment this line layer_outputs[layers[1]] = F.interpolate(layer_outputs[layers[1]], scale_factor=[0.5, 0.5])
@ASONG0506 thanks for your reply, I will try it.
when I run prune.py with follow parameter, Namespace(cfg='cfg/yolov3-spp.cfg', img_size=608, overall_ratio=0.5, perlayer_ratio=0.1, save='prune_0.5_0.1', weights='weights/best.pt') Using CUDA device0 _CudaDeviceProperties(name='GeForce GTX 1060 6GB', total_memory=6078MB)
i get the error:
Traceback (most recent call last): File "/home/broliao/桌面/yolov3-slimyolov3/prune.py", line 396, in opt.perlayer_ratio, File "/home/broliao/桌面/yolov3-slimyolov3/prune.py", line 344, in test inf_out, train_out = pruned_model(imgs) # inference and training outputs File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 493, in call result = self.forward(*input, **kwargs) File "/home/broliao/桌面/yolov3-slimyolov3/models.py", line 226, in forward x = torch.cat([layer_outputs[i] for i in layers], 1) RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 1. Got 13 and 28 in dimension 2 at /pytorch/aten/src/THC/generic/THCTensorMath.cu:71
who can help me?thanks a lot.
师兄,你好,我在win10上配置了这个工程,用来修剪我自己的网络(不是YOLOv3),但是报了下面这个错,你能帮我看看问题出在哪吗?先谢谢师兄了
@broliao @ASONG0506 hai I have encountered the same mistake, have you solved it?
when I run prune.py with follow parameter, Namespace(cfg='cfg/yolov3-spp.cfg', img_size=608, overall_ratio=0.5, perlayer_ratio=0.1, save='prune_0.5_0.1', weights='weights/best.pt') Using CUDA device0 _CudaDeviceProperties(name='GeForce GTX 1060 6GB', total_memory=6078MB)
i get the error:
Traceback (most recent call last): File "/home/broliao/桌面/yolov3-slimyolov3/prune.py", line 396, in opt.perlayer_ratio, File "/home/broliao/桌面/yolov3-slimyolov3/prune.py", line 344, in test inf_out, train_out = pruned_model(imgs) # inference and training outputs File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 493, in call result = self.forward(*input, **kwargs) File "/home/broliao/桌面/yolov3-slimyolov3/models.py", line 226, in forward x = torch.cat([layer_outputs[i] for i in layers], 1) RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 1. Got 13 and 28 in dimension 2 at /pytorch/aten/src/THC/generic/THCTensorMath.cu:71
who can help me?thanks a lot.