WongKinYiu / ScaledYOLOv4

Scaled-YOLOv4: Scaling Cross Stage Partial Network
GNU General Public License v3.0
2.02k stars 574 forks source link

inference yolov4-p5 error #61

Open xuanzhangyang opened 3 years ago

xuanzhangyang commented 3 years ago

at branch yolov4-large: python detect.py --device 6 --weight weights/yolov4-p5.pt --cfg models/yolov4.cfg

error: Traceback (most recent call last): File "detect.py", line 190, in detect() File "detect.py", line 48, in detect load_darknet_weights(model, weights[0]) File "/home/xuan/code/pytorch/ScaledYOLOv4/models/models.py", line 441, in load_darknetweights conv.weight.data.copy(torch.from_numpy(weights[ptr:ptr + nw]).view_as(conv.weight)) RuntimeError: shape '[1024, 512, 3, 3]' is invalid for input of size 2071138

So what is the model input size ?

WongKinYiu commented 3 years ago

it due to you use model of yolov4-csp branch to inference weights of yolov4-large branch. the size is not the problem.