Toybrick

标题: pytorch 转 onnx 再转 rknn 报错 [打印本页]

作者: kkkaaa    时间: 2020-4-21 16:49
标题: pytorch 转 onnx 再转 rknn 报错
从 pytorch 转出来的 onnx 模型通过 onnx.checker.check_model(onnx_model) 没有报错
但是把 onnx 模型转 rknn 模型时报错:
E Catch exception when loading onnx model: /data01/wens/workspace/project/Yet-Another-EfficientDet-Pytorch/weights/efficientdet_d0.onnx!
E Traceback (most recent call last):
E   File "rknn/api/rknn_base.py", line 510, in rknn.api.rknn_base.RKNNBase.load_onnx
E   File "rknn/base/RKNNlib/converter/convert_onnx.py", line 494, in rknn.base.RKNNlib.converter.convert_onnx.convert_onnx.__init__
E   File "rknn/base/RKNNlib/converter/convert_onnx.py", line 504, in rknn.base.RKNNlib.converter.convert_onnx.convert_onnx.__init__
E   File "rknn/base/RKNNlib/converter/onnx_util.py", line 158, in rknn.base.RKNNlib.converter.onnx_util.ONNXProto_Util.polishing_model
E   File "/data01/wens/venv/rknn/lib/python3.6/site-packages/onnx/utils.py", line 18, in polish_model
E     onnx.checker.check_model(model)
E   File "/data01/wens/venv/rknn/lib/python3.6/site-packages/onnx/checker.py", line 86, in check_model
E     C.check_model(model.SerializeToString())
E onnx.onnx_cpp2py_export.checker.ValidationError: Field 'shape' of type is required but missing.

请问这是不是因为转的 onnx 模型的问题?



作者: jefferyzhang    时间: 2020-4-21 16:56
onnx模型先用onnx加载下看是否能正常推理。。

作者: kkkaaa    时间: 2020-4-21 17:10
onnxruntime.InferenceSession 的确报错了




欢迎光临 Toybrick (https://t.rock-chips.com/) Powered by Discuz! X3.3