RuntimeError: The size of tensor a (80) must match the size of tensor b (56) at non-singleton dimension 3
I ran detect.py in YOLOv5-5.0 and it shown me this. How can I fix it?
Here is the problem:
Traceback (most recent call last):
File "F:\python_yolov5\yolov5-5.0\detect.py", line 178, in <module>
detect()
File "F:\python_yolov5\yolov5-5.0\detect.py", line 61, in detect
model(torch.zeros(1, 3, imgsz, imgsz).to(device).type_as(next(model.parameters()))) # run once
File "F:\anaconda\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "F:\python_yolov5\yolov5-5.0\models\yolo.py", line 123, in forward
return self.forward_once(x, profile) # single-scale inference, train
File "F:\python_yolov5\yolov5-5.0\models\yolo.py", line 139, in forward_once
x = m(x) # run
File "F:\anaconda\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "F:\python_yolov5\yolov5-5.0\models\yolo.py", line 55, in forward
y[..., 2:4] = (y[..., 2:4] * 2) ** 2 * self.anchor_grid[i] # wh
RuntimeError: The size of tensor a (80) must match the size of tensor b (56) at non-singleton dimension 3
source https://stackoverflow.com/questions/71473801/runtimeerror-the-size-of-tensor-a-80-must-match-the-size-of-tensor-b-56-at
Comments
Post a Comment