rockchip-linux / rknn-toolkit

BSD 3-Clause "New" or "Revised" License
771 stars 175 forks source link

YOLO V8/V9 ONNX Conversion Error to RKNN #458

Open aayushb-95 opened 1 week ago

aayushb-95 commented 1 week ago

Hi, I am trying to convert YoloV8/V9 ONNX model to RKNN. However, I am getting the following error :

W rknn-toolkit version: 1.7.5
W Catch exception when optimize onnx model, skip it! Exception: Unresolved value references: /model.10/Constant_1_output_0,/model.10/Constant_output_0,/model.13/Constant_1_output_0,/model.13/Constant_output_0,/model.22/Constant_10_output_0,/model.22/Constant_11_output_0,/model.22/Constant_12_output_0,/model.22/Constant_1_output_0,/model.22/Constant_2_output_0,/model.22/Constant_3_output_0,/model.22/Constant_4_output_0,/model.22/Constant_5_output_0,/model.22/Constant_6_output_0,/model.22/Constant_7_output_0,/model.22/Constant_8_output_0,/model.22/Constant_9_output_0,/model.22/Constant_output_0,/model.22/dfl/Constant_1_output_0,/model.22/dfl/Constant_output_0,
--> Config model
Model Configuration failed!
E Calc node Slice : /model.22/Slice output shape fail
E Catch exception when loading onnx model: /home/ayush/yolov8ss.onnx!
E Traceback (most recent call last):
E   File "rknn/base/RKNNlib/onnx_ir/onnx_numpy_backend/shape_inference.py", line 65, in rknn.base.RKNNlib.onnx_ir.onnx_numpy_backend.shape_inference.infer_shape
E   File "rknn/base/RKNNlib/onnx_ir/onnx_numpy_backend/ops/slice.py", line 41, in rknn.base.RKNNlib.onnx_ir.onnx_numpy_backend.ops.slice.Slice
E   File "<string>", line 1, in <module>
E TypeError: slice indices must be integers or None or have an __index__ method
E During handling of the above exception, another exception occurred:
E Traceback (most recent call last):
E   File "rknn/base/RKNNlib/app/importer/import_onnx.py", line 120, in rknn.base.RKNNlib.app.importer.import_onnx.Importonnx.run
E   File "rknn/base/RKNNlib/converter/convert_onnx.py", line 123, in rknn.base.RKNNlib.converter.convert_onnx.convert_onnx.__init__
E   File "rknn/base/RKNNlib/converter/convert_onnx.py", line 1187, in rknn.base.RKNNlib.converter.convert_onnx.convert_onnx._shape_inference
E   File "rknn/base/RKNNlib/onnx_ir/onnx_numpy_backend/shape_inference.py", line 70, in rknn.base.RKNNlib.onnx_ir.onnx_numpy_backend.shape_inference.infer_shape
E   File "rknn/api/rknn_log.py", line 323, in rknn.api.rknn_log.RKNNLog.e
E ValueError: Calc node Slice : /model.22/Slice output shape fail
E Please feedback the detailed log file <log_feedback_to_the_rknn_toolkit_dev_team.log> to the RKNN Toolkit development team.
E You can also check github issues: https://github.com/rockchip-linux/rknn-toolkit/issues

Process finished with exit code 255 

Any help on this, will be highly appreciated. Thanks in advance