|
本帖最后由 kkkaaa 于 2020-4-22 17:42 编辑
pytorch 模型转 onnx 成功, onnxruntime 可推理, 且 onnx 模型与 pytorch 模型推理结果一致
但是转 rknn 失败,报错如下
E Try match Gather_1322ut0 failed, catch exception!
W ----------------Warning(1)----------------
E Catch exception when loading onnx model: ../debug_log/truncated_debug_d0_num_classes80.onnx!
E Traceback (most recent call last):
E File "rknn/base/RKNNlib/converter/convert_onnx.py", line 1071, in rknn.base.RKNNlib.converter.convert_onnx.convert_onnx.match_paragraph_and_param
E File "rknn/base/RKNNlib/converter/convert_onnx.py", line 980, 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 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 Gather_1322ut0 failed, catch exception!
Load effdet_d0 failed!
谢谢~
补充:
我正在通过改变模型返回值定位问题,当我修改输出时,报错信息变了(onnx 模型和 pytorch 模型推理结果一致),如下:
--> Building model
W The target_platform is not set in config, using default target platform rk1808.
W Genreate input meta fail, please check model.
W External input meta file "/tmp/tmpl2_5vz4x/torchjitexport_inputmeta.yml" is not exists.
Traceback (most recent call last):
File "test_no_quant.py", line 83, in <module>
ret = rknn.build(do_quantization=False, dataset='./dataset.txt')
File "/data01/wens/venv/rknn/lib/python3.6/site-packages/rknn/api/rknn.py", line 240, in build
ret = self.rknn_base.build(do_quantization=do_quantization, dataset=dataset, pack_vdata=pre_compile, batch_size=rknn_batch_size)
File "rknn/api/rknn_base.py", line 791, in rknn.api.rknn_base.RKNNBase.build
File "rknn/api/rknn_base.py", line 2328, in rknn.api.rknn_base.RKNNBase._generate_inputmeta
IndexError: list index out of range
|
|