rknn-toolkit icon indicating copy to clipboard operation
rknn-toolkit copied to clipboard

关于onnx转换rknn问题

Open miyane-ralo opened this issue 2 years ago • 3 comments

pth>onnx: env:pc 、python3.7、onnx=1.6.0、torch=1.8.1 onnx>rknn: env:rk3399+rk1808、python3.7、onnx=1.6.0、rknn_toolkit=1.6.0、torch=1.6.0 Related file links:链接:https://pan.baidu.com/s/1C6hSnbGKns4btDjZbIHvgg 提取码:9966 Problem Description:

--> config model done --> Loading model W Call onnx.optimizer.optimize fail, skip optimize E Calc node Conv : Conv_0 output shape fail W ----------------Warning(1)---------------- E Catch exception when loading onnx model: openpose.onnx! E Traceback (most recent call last): E File "rknn/base/RKNNlib/onnx_ir/onnx_numpy_backend/shape_inference.py", line 57, in rknn.base.RKNNlib.onnx_ir.onnx_numpy_backend.shape_inference.infer_shape E File "rknn/base/RKNNlib/onnx_ir/onnx_numpy_backend/ops/conv.py", line 49, in rknn.base.RKNNlib.onnx_ir.onnx_numpy_backend.ops.conv.Conv E File "/home/linaro/.local/lib/python3.7/site-packages/torch/init.py", line 19, in E exit(-1) E File "/usr/local/lib/python3.7/_sitebuiltins.py", line 26, in call E raise SystemExit(code) E SystemExit: -1 E During handling of the above exception, another exception occurred: E Traceback (most recent call last): E File "rknn/api/rknn_base.py", line 264, in rknn.api.rknn_base.RKNNBase.load_onnx E File "rknn/base/RKNNlib/RK_nn.py", line 135, in rknn.base.RKNNlib.RK_nn.RKnn.load_onnx E File "rknn/base/RKNNlib/app/importer/import_onnx.py", line 111, in rknn.base.RKNNlib.app.importer.import_onnx.Importonnx.run E File "rknn/base/RKNNlib/converter/convert_onnx.py", line 85, in rknn.base.RKNNlib.converter.convert_onnx.convert_onnx.init E File "rknn/base/RKNNlib/converter/convert_onnx.py", line 434, 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 62, in rknn.base.RKNNlib.onnx_ir.onnx_numpy_backend.shape_inference.infer_shape E File "rknn/api/rknn_log.py", line 312, in rknn.api.rknn_log.RKNNLog.e E ValueError: Calc node Conv : Conv_0 output shape fail

miyane-ralo avatar Mar 03 '22 04:03 miyane-ralo

I have encountered the same problem. Have you solved it?

SouthIO avatar May 14 '22 07:05 SouthIO

I have encoutered the same problem too, Have you solved it?

sunnythree avatar Aug 05 '22 01:08 sunnythree

rk3399 with the sdk, works only for python2.7 atm it seems, so the conversions for torch might not be available between those different python versions. Idk if that can be the cause of the problem. After a long time debugging, I finally found this link which explains how to properly install opencv for the sdk:

According to the official website, their chips can accelerate tensorflow. I am heartbroken because their sample programs are all python 2.7.

The latest examples of tensorflow are all python 3.8

MarioCavero avatar Nov 22 '22 15:11 MarioCavero