Toybrick

标题: 求助rnkk_toolkit换成1.3.2版本,onnx转rknn还是有问题,不知道.... [打印本页]

作者: sotnly    时间: 2020-6-5 09:26
标题: 求助rnkk_toolkit换成1.3.2版本,onnx转rknn还是有问题,不知道....
--> Loading model
/home/xjw/.local/lib/python3.6/site-packages/onnx_tf/common/__init__.py:87: UserWarning: FrontendHandler.get_outputs_names is deprecated. It will be removed in future release.. Use node.outputs instead.
  warnings.warn(message)
E Catch exception when loading onnx model: ../weights/RFB_640_cut.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 502, in rknn.base.RKNNlib.converter.convert_onnx.convert_onnx.__init__
E   File "rknn/base/RKNNlib/converter/onnx_util.py", line 154, in rknn.base.RKNNlib.converter.onnx_util.ONNXProto_Util.optim_model
E   File "/home/xjw/.local/lib/python3.6/site-packages/onnx/optimizer.py", line 55, in optimize
E     optimized_model_str = C.optimize(model_str, passes)
E IndexError: _Map_base::at
Traceback (most recent call last):
  File "/home/xjw/computer/tool/pycharm/pycharm-professional-2019.3.3/pycharm-2019.3.3/plugins/python/helpers/pydev/pydevd.py", line 1434, in _exec
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "/home/xjw/computer/tool/pycharm/pycharm-professional-2019.3.3/pycharm-2019.3.3/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "/home/xjw/computer/program/python/zhs_face_detect_recongnize_project/RKNN/test.py", line 34, in <module>
    rknn.build(do_quantization=False)
  File "/home/xjw/.local/lib/python3.6/site-packages/rknn/api/rknn.py", line 222, in build
    inputs = self.rknn_base.net.get_input_layers()
AttributeError: 'NoneType' object has no attribute 'get_input_layers'
done
--> Building model


作者: sotnly    时间: 2020-6-5 09:32
我在安装rknn1.3.2的时候是按照官方步骤走的,但是这个ruamel-yaml报错,说版本不对,我尝试卸了重装但是不行,不知道这样对不对
作者: jefferyzhang    时间: 2020-6-5 10:05
你先别管rknn,你的错误是错在onnx包里的,
File "/home/xjw/.local/lib/python3.6/site-packages/onnx/optimizer.py", line 55, in optimize
先验证下这个onnx库能否正确读出你的onnx模型。
看你二楼发的这些错,包版本依赖关系像是都乱了。检查下rknntoolkit文档要求的onnx是啥版本

作者: sotnly    时间: 2020-6-5 10:43
jefferyzhang 发表于 2020-6-5 10:05
你先别管rknn,你的错误是错在onnx包里的,
File "/home/xjw/.local/lib/python3.6/site-packages/onnx/op ...

I Match concat_2 [['Concat_boxes']] [['Concat']] to [['concat']]
I Try match Softmax_scoresut0
I Match r_softmax [['Softmax_scores']] [['Softmax']] to [['softmax']]
I Try match Sub_480ut0
I Match r_sub [['Sub_480']] [['Sub']] to [['subtract']]
I Try match Add_485ut0
I Match r_add [['Add_485']] [['Add']] to [['add']]
I Try match Concat_459ut0
I Match concat_4 [['Concat_459']] [['Concat']] to [['concat']]
I Try match Slice_476ut0
E Try match Slice_476ut0 failed, catch exception!
I ----------------Warning(0)----------------
E Catch exception when loading onnx model: ../weights/version_RFB_640_cut.onnx!
E Traceback (most recent call last):
E   File "rknn/base/RKNNlib/converter/convert_onnx.py", line 1038, in rknn.base.RKNNlib.converter.convert_onnx.convert_onnx.match_paragraph_and_param
E   File "rknn/base/RKNNlib/converter/convert_onnx.py", line 888, in rknn.base.RKNNlib.converter.convert_onnx.convert_onnx._onnx_try_match_ruler
E   File "<string>", line 1, in <module>
E KeyError: 'Slice'
E During handling of the above exception, another exception occurred:
E Traceback (most recent call last):
E   File "rknn/api/rknn_base.py", line 513, in rknn.api.rknn_base.RKNNBase.load_onnx
E   File "rknn/base/RKNNlib/converter/convert_onnx.py", line 1077, in rknn.base.RKNNlib.converter.convert_onnx.convert_onnx.match_paragraph_and_param
E   File "rknn/api/rknn_log.py", line 312, in rknn.api.rknn_log.RKNNLog.e
E ValueError: Try match Slice_476ut0 failed, catch exception!
D target set by user is: None

我仔细看了手册,确保了我的这个没有问题,还是slice,切片这个没有,我之前用teigine转的时候,也出现过,可能这个需要提交一下




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