Toybrick

标题: load_onnx报错 [打印本页]

作者: yaowei    时间: 2019-5-15 09:36
标题: load_onnx报错
rknn 1.0.0和0.9.9都试过。

模型文件:https://s3.amazonaws.com/onnx-model-zoo/arcface/resnet100.onnx


转换程序:
  1. from rknn.api import RKNN

  2. rknn = RKNN()

  3. rknn.config(channel_mean_value='127.5 127.5 127.5 128', reorder_channel='0 1 2')

  4. print('--> Loading model')
  5. rknn.load_onnx(model='./resnet100.onnx')
  6. print('done')

  7. print('--> Building model')
  8. rknn.build(do_quantization=False)
  9. print('done')

  10. rknn.export_rknn('./resnet100.rknn')

  11. rknn.release()
复制代码


报错:
  1. --> Loading model
  2. W Not match tensor MatMul_464:out0
  3. E Catch exception when loading onnx model: ./resnet100.onnx!
  4. T Traceback (most recent call last):
  5. T   File "rknn/api/rknn_base.py", line 344, in rknn.api.rknn_base.RKNNBase.load_onnx
  6. T   File "rknn/base/RKNNlib/converter/convert_onnx.py", line 1037, in rknn.base.RKNNlib.converter.convert_onnx.convert_onnx.match_paragraph_and_param
  7. T   File "rknn/base/RKNNlib/converter/convert_onnx.py", line 950, in rknn.base.RKNNlib.converter.convert_onnx.convert_onnx._onnx_push_ready_tensor
  8. T TypeError: 'NoneType' object is not iterable
复制代码



作者: jefferyzhang    时间: 2019-5-17 12:24
rknn = RKNN(verbose=True)
请把verbose打开,不然看不到什么有用的 log
作者: yaowei    时间: 2019-5-17 14:20
目前rknn版本1.0.0

  1. W verbose file path is invalid, debug info will not dump to file.
  2. --> Loading model
  3. I Current ONNX Model use ir_version 3 opset_version 8
  4. D import clients finished
  5. I build output layer attach_BatchNormalization_466:out0
  6. I Try match BatchNormalization_466:out0
  7. I Match r_bn_v6 [['BatchNormalization_466', 'Initializer_770', 'Initializer_771', 'Initializer_772', 'Initializer_773']] [['BatchNormalization', 'Constant_0', 'Constant_1', 'Constant_2', 'Constant_3']] to [['batchnormalize']]
  8. I Try match Add_465:out0
  9. I Match r_add [['Add_465']] [['Add']] to [['add']]
  10. I Try match MatMul_464:out0
  11. W Not match tensor MatMul_464:out0
  12. E Catch exception when loading onnx model: ./resnet100.onnx!
  13. T Traceback (most recent call last):
  14. T   File "rknn/api/rknn_base.py", line 344, in rknn.api.rknn_base.RKNNBase.load_onnx
  15. T   File "rknn/base/RKNNlib/converter/convert_onnx.py", line 1037, in rknn.base.RKNNlib.converter.convert_onnx.convert_onnx.match_paragraph_and_param
  16. T   File "rknn/base/RKNNlib/converter/convert_onnx.py", line 950, in rknn.base.RKNNlib.converter.convert_onnx.convert_onnx._onnx_push_ready_tensor
  17. T TypeError: 'NoneType' object is not iterable
  18. done
  19. --> Building model
  20. E Model or data is None, please load model first.
  21. done
  22. E RKNN model data is None, please load model first!
复制代码

作者: yaowei    时间: 2019-5-17 14:23
感谢版版还记得这个帖子,现在onnx版本1.5.0,我降到过1.2.0,也是有问题
作者: wschong    时间: 2019-6-24 14:55
请问如何解决 load_onnx 报错.

T TypeError: 'NoneType' object is not iterable

使用rknn v1.0.0
load_tflite OK

完整LOG
  1. --> config model
  2. done
  3. --> Loading ONNX model
  4. I Current ONNX Model use ir_version 4 opset_version 9
  5. D import clients finished
  6. I build output layer attach_BatchNormalization_31:out0
  7. I build output layer attach_Div_39:out0
  8. I Try match Div_39:out0
  9. I Match r_div [['Div_39']] [['Div']] to [['divide']]
  10. I Try match BatchNormalization_31:out0
  11. I Match r_bn_v6 [['BatchNormalization_31', 'Initializer_83', 'Initializer_79', 'Initializer_81', 'Initializer_82']] [['BatchNormalization', 'Constant_0', 'Constant_1', 'Constant_2', 'Constant_3']] to [['batchnormalize']]
  12. I Try match BatchNormalization_36:out0
  13. I Match r_bn_v6 [['BatchNormalization_36', 'Initializer_69', 'Initializer_65', 'Initializer_67', 'Initializer_68']] [['BatchNormalization', 'Constant_0', 'Constant_1', 'Constant_2', 'Constant_3']] to [['batchnormalize']]
  14. I Try match Unsqueeze_38:out0
  15. I Match r_unsqueeze [['Unsqueeze_38']] [['Unsqueeze']] to [['reshape']]
  16. I Try match Conv_30:out0
  17. I Match r_conv [['Conv_30', 'Initializer_78', 'Initializer_77']] [['Conv', 'Constant_0', 'Constant_1']] to [['convolution']]
  18. I Try match Conv_35:out0
  19. I Match r_conv [['Conv_35', 'Initializer_64', 'Initializer_63']] [['Conv', 'Constant_0', 'Constant_1']] to [['convolution']]
  20. I Try match ReduceL2_37:out0
  21. W Not match tensor ReduceL2_37:out0
  22. E Catch exception when loading onnx model: /N/share/build/rknn/rknn-toolkit/example/mobilenet_v1_onnx/superpoint_v1_ws.onnx!
  23. T Traceback (most recent call last):
  24. T   File "rknn/api/rknn_base.py", line 344, in rknn.api.rknn_base.RKNNBase.load_onnx
  25. T   File "rknn/base/RKNNlib/converter/convert_onnx.py", line 1037, in rknn.base.RKNNlib.converter.convert_onnx.convert_onnx.match_paragraph_and_param
  26. T   File "rknn/base/RKNNlib/converter/convert_onnx.py", line 950, in rknn.base.RKNNlib.converter.convert_onnx.convert_onnx._onnx_push_ready_tensor
  27. T TypeError: 'NoneType' object is not iterable
  28. Load superpoint_v1.onnx failed!

  29. Process finished with exit code 255
复制代码

作者: wschong    时间: 2019-6-24 14:57
yaowei 发表于 2019-5-17 14:20
目前rknn版本1.0.0

Hi @jefferyzhang, @yaowei,先谢谢指点!
作者: zjmmm    时间: 2020-6-30 09:01
yaowei 发表于 2019-5-17 14:20
目前rknn版本1.0.0

您好,请问W verbose file path is invalid, debug info will not dump to file.这个报错你是怎么解决的?
作者: leok    时间: 2020-6-30 11:23
wschong 发表于 2019-6-24 14:57
Hi @jefferyzhang, @yaowei,先谢谢指点!

rknn toolkit可以升级到1.3.2比较好定位问题。
作者: leok    时间: 2020-6-30 11:23
wschong 发表于 2019-6-24 14:57
Hi @jefferyzhang, @yaowei,先谢谢指点!

rknn toolkit可以升级到1.3.2比较好定位问题。




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