【yolov5】yolov5运行时报错处理

E:\sort\Anaconda\envs\yolov5-5.0\python.exe E:/code/yolov5-5.0/detect.py
Namespace(agnostic_nms=False, augment=False, classes=None, conf_thres=0.25, device='', exist_ok=False, img_size=640, iou_thres=0.45, name='exp', nosave=False, project='runs/detect', save_conf=False, save_txt=False, source='data/images', update=False, view_img=False, weights='yolov5s.pt')
YOLOv5  2021-4-12 torch 1.11.0+cpu CPU

Fusing layers... 
Model Summary: 213 layers, 7225885 parameters, 0 gradients
image 1/2 E:\code\yolov5-5.0\data\images\bus.jpg: E:\sort\Anaconda\envs\yolov5-5.0\lib\site-packages\torch\functional.py:568: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at  C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\TensorShape.cpp:2228.)
  return _VF.meshgrid(tensors, **kwargs)  # type: ignore[attr-defined]
Traceback (most recent call last):
  File "E:/code/yolov5-5.0/detect.py", line 178, in
    detect()
  File "E:/code/yolov5-5.0/detect.py", line 72, in detect
    pred = model(img, augment=opt.augment)[0]
  File "E:\sort\Anaconda\envs\yolov5-5.0\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "E:\code\yolov5-5.0\models\yolo.py", line 123, in forward
    return self.forward_once(x, profile)  # single-scale inference, train
  File "E:\code\yolov5-5.0\models\yolo.py", line 139, in forward_once
    x = m(x)  # run
  File "E:\sort\Anaconda\envs\yolov5-5.0\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "E:\code\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 (60) must match the size of tensor b (56) at non-singleton dimension 3

进程已结束,退出代码1
大佬们,这个怎么解决

你可能感兴趣的:(python)