You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you.However, I found that this problem may be caused by the fact that the pre-training model was not generated after sparsity training during pruning.
大神您好,我在进行prune模型时,出现[59, 64, 'M', 128, 128, 'M', 256, 256, 256, 256, 'M', 470, 239, 59, 40, 'M', 0, 3, 54, 483],有一层卷积数量是0,然后就报错了,怎么解决呢?
[59, 64, 'M', 128, 128, 'M', 256, 256, 256, 256, 'M', 470, 239, 59, 40, 'M', 0, 3, 54, 483]
Traceback (most recent call last):
File "prune.py", line 111, in
newmodel = vgg(cfg=cfg)
File "/home/wxl/temp/pytorch-slimming/vgg.py", line 13, in init
self.feature = self.make_layers(cfg, True)
File "/home/wxl/temp/pytorch-slimming/vgg.py", line 30, in make_layers
conv2d = nn.Conv2d(in_channels, v, kernel_size=3, padding=1, bias=False)
File "/home/wxl/project/py36/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 330, in init
False, pair(0), groups, bias, padding_mode)
File "/home/wxl/project/py36/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 46, in init
self.reset_parameters()
File "/home/wxl/project/py36/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 49, in reset_parameters
init.kaiming_uniform(self.weight, a=math.sqrt(5))
File "/home/wxl/project/py36/lib/python3.6/site-packages/torch/nn/init.py", line 314, in kaiming_uniform_
fan = _calculate_correct_fan(tensor, mode)
File "/home/wxl/project/py36/lib/python3.6/site-packages/torch/nn/init.py", line 283, in _calculate_correct_fan
fan_in, fan_out = _calculate_fan_in_and_fan_out(tensor)
File "/home/wxl/project/py36/lib/python3.6/site-packages/torch/nn/init.py", line 215, in _calculate_fan_in_and_fan_out
receptive_field_size = tensor[0][0].numel()
IndexError: index 0 is out of bounds for dimension 0 with size 0
@ @ @foolwood
The text was updated successfully, but these errors were encountered: