rockchip-linux / rknn-toolkit2

BSD 3-Clause "New" or "Revised" License
903 stars 154 forks source link

error to convert onnx to rknn model (inception resnet) #25

Open sistemasmi13 opened 2 years ago

sistemasmi13 commented 2 years ago

Hi, could you please help me with the following error: I'm trying to convert Inception Resnet V1 model (https://github.com/timesler/facenet-pytorch) to RKNN format following this example https://github.com/rockchip-linux/rknn-toolkit2/tree/master/examples/onnx/yolov5. The model is already in ONNX format and when trying to load the model with the python rknn module (rknn.load_onnx) I get the following error: E load_onnx: Catch exception when loading onnx model: /media/desarrollo10/CAROLINA/MonitoreoInteligente/rockchip/RK356x/examples/onnx/yolov5/model_us/InceptionResnetV1_v2.onnx! E load_onnx: Traceback (most recent call last): E load_onnx: File "rknn/api/rknn_base.py", line 1126, in rknn.api.rknn_base.RKNNBase.load_onnx E load_onnx: File "rknn/api/rknn_base.py", line 584, in rknn.api.rknn_base.RKNNBase._create_ir_and_inputs_meta E load_onnx: File "rknn/api/ir_graph.py", line 39, in rknn.api.ir_graph.IRGraph.init E load_onnx: File "rknn/api/ir_graph.py", line 180, in rknn.api.ir_graph.IRGraph.rebuild E load_onnx: File "rknn/api/ir_graph.py", line 140, in rknn.api.ir_graph.IRGraph._clean_model E load_onnx: File "rknn/api/ir_graph.py", line 59, in rknn.api.ir_graph.IRGraph.infer_shapes E load_onnx: File "/home/desarrollo10/Documentos/rockchip/venv/lib/python3.6/site-packages/onnx/checker.py", line 93, in check_model E load_onnx: C.check_model(model.SerializeToString()) E load_onnx: onnx.onnx_cpp2py_export.checker.ValidationError: Field 'shape' of type is required but missing.

wen-flow commented 1 year ago

Hello, I have encountered the same problem. How did you solve it? thank you!