kaylorchen / rk3588-yolo-demo

The project is a multi-threaded inference demo of Yolo running on the RK3588 platform, which has been adapted for reading video files and camera feeds. The demo uses the Yolov8n model for file inference, with a maximum inference frame rate of up to 100 frames per second.
MIT License
196 stars 26 forks source link

yolov10在Model pt --> onnx环节有问题 #17

Closed jumengbo closed 1 month ago

jumengbo commented 3 months ago

我用了你的yolov10仓库,导出了onnx模型,但是转换为rknn模型时报错,用了你仓库的onnx模型转rknn却是成功的

(toolkit2_py3.8) book@100ask:~/Desktop/onnx->rknn/rk3588-convert-to-rknn-master$ python convert.py yolov10s.onnx rk3566 i8 yolov10.rknn I rknn-toolkit2 version: 2.0.0b0+9bab5682 --> Config model done --> Loading model I It is recommended onnx opset 19, but your onnx model opset is 13! I Model converted from pytorch, 'opset_version' should be set 19 in torch.onnx.export for successful convert! I Loading : 0%| | 0/I Loading : 100%|██████████████████████████████████████████████| 193/193 [00:00<00:00, 24905.41it/s] done --> Building model E build: The input 0 of TopK('/model.23/TopK') need to be constant! It will cause the graph to be a dynamic graph! Remove TopK('/model.23/TopK') manually and try again! I ===================== WARN(0) ===================== E rknn-toolkit2 version: 2.0.0b0+9bab5682 E build: Catch exception when building RKNN model! E build: Traceback (most recent call last): E build: File "rknn/api/rknn_base.py", line 1977, in rknn.api.rknn_base.RKNNBase.build E build: File "rknn/api/graph_optimizer.py", line 814, in rknn.api.graph_optimizer.GraphOptimizer.fold_constant E build: File "rknn/api/graph_optimizer.py", line 361, in rknn.api.graph_optimizer._dynamic_check E build: File "rknn/api/rknn_log.py", line 92, in rknn.api.rknn_log.RKNNLog.e E build: ValueError: The input 0 of TopK('/model.23/TopK') need to be constant! It will cause the graph to be a dynamic graph! E build: Remove TopK('/model.23/TopK') manually and try again! W If you can't handle this error, please try updating to the latest version of the toolkit2 and runtime from: https://console.zbox.filez.com/l/I00fc3 (Pwd: rknn) Path: RKNPU2_SDK / 2.X.X / develop / If the error still exists in the latest version, please collect the corresponding error logs and the model, convert script, and input data that can reproduce the problem, and then submit an issue on: https://redmine.rock-chips.com (Please consult our sales or FAE for the redmine account)

kaylorchen commented 2 months ago

我的onnx输出头改过了,你这个提示了就是不能用topk