talebolano / yolov3-network-slimming

yolov3 network slimming剪枝的一种实现
345 stars 93 forks source link

RuntimeError: shape is invalid for input of size ... #26

Open thorstenbar opened 5 years ago

thorstenbar commented 5 years ago

Hello, I followed the steps provided in the readme. But the resulting weights and config file throw an error when trying to use them in an yolov3 implementation.

Traceback (most recent call last):
  File "detect.py", line 48, in <module>
    model.load_darknet_weights(opt.weights_path)
  File "/home/_/Desktop/PyTorch-YOLOv3/models.py", line 315, in load_darknet_weights
    conv_w = torch.from_numpy(weights[ptr : ptr + num_w]).view_as(conv_layer.weight)
RuntimeError: shape '[125, 106, 3, 3]' is invalid for input of size 14720

Anyone has an idea why? I am using a trained model with 25 classes and yolov3-spp i followed the issue on yolov3-tiny to make it working. For the training i used batch=5, subdivisions=10, epoch=1, size=608 and dataset with 300.000 Pictures. Thanks.

Chiaquan commented 5 years ago

same error, have you fixed it?

thorstenbar commented 5 years ago

Sorry i didn't fix it