Toybrick

load_onnx报错

yaowei

中级会员

积分
375
楼主
发表于 2019-5-15 09:36:46    查看: 11118|回复: 8 | [复制链接]    打印 | 只看该作者
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

版主

积分
13580
沙发
发表于 2019-5-17 12:24:28 | 只看该作者
rknn = RKNN(verbose=True)
请把verbose打开,不然看不到什么有用的 log
回复

使用道具 举报

yaowei

中级会员

积分
375
板凳
 楼主| 发表于 2019-5-17 14:20:31 | 只看该作者
目前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

中级会员

积分
375
地板
 楼主| 发表于 2019-5-17 14:23:40 | 只看该作者
感谢版版还记得这个帖子,现在onnx版本1.5.0,我降到过1.2.0,也是有问题
回复

使用道具 举报

wschong

新手上路

积分
37
5#
发表于 2019-6-24 14:55:33 | 只看该作者
请问如何解决 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

新手上路

积分
37
6#
发表于 2019-6-24 14:57:58 | 只看该作者
yaowei 发表于 2019-5-17 14:20
目前rknn版本1.0.0

Hi @jefferyzhang, @yaowei,先谢谢指点!
回复

使用道具 举报

zjmmm

中级会员

积分
304
7#
发表于 2020-6-30 09:01:06 | 只看该作者
yaowei 发表于 2019-5-17 14:20
目前rknn版本1.0.0

您好,请问W verbose file path is invalid, debug info will not dump to file.这个报错你是怎么解决的?
回复

使用道具 举报

leok

版主

积分
894
8#
发表于 2020-6-30 11:23:32 | 只看该作者
wschong 发表于 2019-6-24 14:57
Hi @jefferyzhang, @yaowei,先谢谢指点!

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

使用道具 举报

leok

版主

积分
894
9#
发表于 2020-6-30 11:23:40 | 只看该作者
wschong 发表于 2019-6-24 14:57
Hi @jefferyzhang, @yaowei,先谢谢指点!

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

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

产品中心 购买渠道 开源社区 Wiki教程 资料下载 关于Toybrick


快速回复 返回顶部 返回列表