You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is probably caused by the different onnx opset_version setting when exporting onnx model. We check again that the example work well using opset_version_11.
使用yolov5s的onnx转rknn时,参照examples\onnx\yolov5\test.py会报错如下:
--> Export RKNN model
done
--> Init runtime environment
librknn_runtime version 1.7.0 (9ad5c07 build: 2021-08-06 15:20:31 base: 1131)
done
--> Running model
Traceback (most recent call last):
File "test.py", line 298, in
boxes, classes, scores = yolov5_post_process(input_data)
File "test.py", line 139, in yolov5_post_process
b, c, s = process(input, mask, anchors)
File "test.py", line 56, in process
col = col.reshape(grid_h, grid_w, 1, 1).repeat(3, axis=-2)
ValueError: cannot reshape array of size 7225 into shape (40,85,1,1)
原因:
观察转换后的rknn模型,输出的通道顺序有问题,定位后发现输出节点选择不对。
解决方法:
将:ret = rknn.load_onnx(model=ONNX_MODEL,outputs=['396', '458', '520'])
改为:ret = rknn.load_onnx(model=ONNX_MODEL,outputs=['396', '457', '518'])
The text was updated successfully, but these errors were encountered: