Firefly开源社区

打印 上一主题 下一主题

[技术讨论] Nanodet模型onnx转rknn报错Loading dynamic inputs model is not support

72

积分

0

威望

0

贡献

技术小白

积分
72

Nanodet模型onnx转rknn报错Loading dynamic inputs model is not support

发表于 2022-3-14 17:12:34      浏览:6161 | 回复:2        打印      只看该作者   [复制链接] 楼主
本帖最后由 cxr 于 2022-3-14 19:22 编辑

py=3.6 rknntoolket=1.7.1
使用1.6.0版本报错
报错内容:
--> Config model
done
--> Loading model
W Not match tensor Slice_Slice_355:out0
E Try match Slice_Slice_355:out0 failed, catch exception!
W ----------------Warning(1)----------------
E Catch exception when loading onnx model: nanodet_sim.onnx!
E Traceback (most recent call last):
E   File "rknn\base\RKNNlib\converter\convert_onnx.py", line 826, in rknn.base.RKNNlib.converter.convert_onnx.convert_onnx.match_paragraph_and_param
E   File "rknn\base\RKNNlib\converter\convert_onnx.py", line 728, in rknn.base.RKNNlib.converter.convert_onnx.convert_onnx._onnx_push_ready_tensor
E TypeError: 'NoneType' object is not iterable
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 121, in rknn.base.RKNNlib.app.importer.import_onnx.Importonnx.run
E   File "rknn\base\RKNNlib\converter\convert_onnx.py", line 832, 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_Slice_355:out0 failed, catch exception!
Load failed!

Process finished with exit code -1

使用1.7.1版本报错
--> Config model
done
--> Loading model
W Detect Input node:1325 is dynamic input, the shape info is [0]
W Use the follow command to see more detail and try to fix the dynamic dim
W python -m rknn.bin.freeze_inshape_for_onnx_model -h
E Loading dynamic inputs model is not support, please fix it first
E Catch exception when loading onnx model: nanodet_sim.onnx!
E Traceback (most recent call last):
E   File "rknn\base\RKNNlib\RK_nn.py", line 141, in rknn.base.RKNNlib.RK_nn.RKnn.load_onnx
E   File "rknn\base\RKNNlib\app\importer\import_onnx.py", line 118, in rknn.base.RKNNlib.app.importer.import_onnx.Importonnx.run
E   File "rknn\base\RKNNlib\converter\convert_onnx.py", line 68, in rknn.base.RKNNlib.converter.convert_onnx.convert_onnx.__init__
E   File "rknn\base\RKNNlib\converter\convert_onnx.py", line 73, in rknn.base.RKNNlib.converter.convert_onnx.convert_onnx.__init__
E   File "rknn\api\rknn_log.py", line 323, in rknn.api.rknn_log.RKNNLog.e
E ValueError: Loading dynamic inputs model is not support, please fix it first
E Please feedback the detailed log file <log_feedback_to_the_rknn_toolkit_dev_team.log> to the RKNN Toolkit development team.
E You can also check github issues: https://github.com/rockchip-linux/rknn-toolkit/issues
Load failed!


回复

使用道具 举报

72

积分

0

威望

0

贡献

技术小白

积分
72
发表于 2022-3-14 17:19:30        只看该作者  沙发
本帖最后由 cxr 于 2022-3-14 23:30 编辑

运行rockchip提供的Python freeze_inshape_for_onnx_model.py以固定shape,显示有236种输入,236不清楚是如何得来的


Python freeze_inshape_for_onnx_model.py --onnx_file_path nanodet_sim.onnx --output_path model_out.onnx --inputs_shape 1,3,768,576#2,3,768,576

Traceback (most recent call last):
  File "freeze_inshape_for_onnx_model.py", line 116, in <module>
    state = fdt.run()
  File "freeze_inshape_for_onnx_model.py", line 72, in run
    dynamic_input = self.check_dynamic_input()
  File "freeze_inshape_for_onnx_model.py", line 37, in check_dynamic_input
    assert inputs_number==len(self.inputs_shape),"model has {} inputs, but {} inputs_shape was given, not match".format(inputs_number,len(self.inputs_shape
))
AssertionError: model has 236 inputs, but 2 inputs_shape was given, not match


回复

使用道具 举报

72

积分

0

威望

0

贡献

技术小白

积分
72
发表于 2022-3-14 19:20:21        只看该作者  板凳
本帖最后由 cxr 于 2022-3-14 19:22 编辑

更新到rknn_toolkit-1.7.1-cp36-cp36m-win_amd64.whl,出Loading dynamic inputs model is not support, please fix it first,请问对于动态输入层有什么解决方案吗
回复

使用道具 举报

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

本版积分规则

友情链接 : 爱板网 电子发烧友论坛 云汉电子社区 粤ICP备14022046号-2
快速回复 返回顶部 返回列表