Loading

Yolov5-lite export.py 导出onnx模型运行报错【ValueError: operands could not be broadcast together with shapes (3,2,40,6) (4800,2) 】

使用export.py转换onnx后报错:数组形状不匹配

ine 54, in cal_outputs
    outs[row_ind:row_ind + length, 0:2] = (outs[row_ind:row_ind + length, 0:2] * 2. - 0.5 + np.tile(grid[i], (na, 1))) * int(stride[i])
                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
ValueError: operands could not be broadcast together with shapes (3,2,40,6) (4800,2) 

解决办法:打开export.py,找到第51行,将store_true更改为store_false

parser.add_argument('--concat', action='store_false', help='concat or not') #store_true
posted @ 2025-04-21 14:59  CIOZ  阅读(109)  评论(0)    收藏  举报