Toybrick

标题: RKNN 中onnx 模型转换问题 RKNN_ERR_MODEL_INVALID [打印本页]

作者: 281963347    时间: 2019-12-4 11:05
标题: RKNN 中onnx 模型转换问题 RKNN_ERR_MODEL_INVALID
我尝试将一个pytorch模型转换为onnx,成功了,但是 onnx 模型转换成rknn却失败.我怀疑问题可能出在模型输入上.  模型输入为 (1,3,480,640) 即 第二维是通道数.
onnx 版本是 1.4.1  RKNN Toolkit 1.2.1 API 1.2.0
中间打印的日志:
--> Loading model
W Do not support shape > 4.
W Unhandle status: the input shape of reshape layer Reshape_183_12 is not 4-D
W Do not support shape > 4.
W Unhandle status: the input shape of reshape layer Reshape_187_13 is not 4-D
W Do not support shape > 4.
W Unhandle status: the input shape of reshape layer Reshape_191_14 is not 4-D
W Warning: Axis may need to be adjusted according to original model shape.
W Warning: Axis may need to be adjusted according to original model shape.
W Warning: Axis may need to be adjusted according to original model shape.
done
--> Building model
W Do not support shape > 4.
W Unhandle status: the input shape of reshape layer Reshape_183_12 is not 4-D
W Do not support shape > 4.
W Unhandle status: the input shape of reshape layer Reshape_187_13 is not 4-D
W Do not support shape > 4.
W Unhandle status: the input shape of reshape layer Reshape_191_14 is not 4-D
W Warning: Axis may need to be adjusted according to original model shape.
W Warning: Axis may need to be adjusted according to original model shape.
W Warning: Axis may need to be adjusted according to original model shape.


--> Init runtime environment
E RKNNAPI: rknn_init,  msg_load_ack fail, ack = 1(ACK_FAIL), expect 0(ACK_SUCC)!
E RKNNAPI: ==============================================
E RKNNAPI: RKNN VERSION:
E RKNNAPI:   API: 1.2.0 (1190a71 build: 2019-09-25 12:39:14)
E RKNNAPI:   DRV: 0.9.8 (943f8e8 build: 2019-07-03 17:51:17)
E RKNNAPI: ==============================================
E Catch exception when init runtime!
E Traceback (most recent call last):
E   File "rknn/api/rknn_base.py", line 788, in rknn.api.rknn_base.RKNNBase.init_runtime
E   File "rknn/api/rknn_runtime.py", line 303, in rknn.api.rknn_runtime.RKNNRuntime.build_graph
E Exception: RKNN init failed. error code: RKNN_ERR_MODEL_INVALID
E Current device id is: None
E Devices connected:
Init runtime environment failed
E ['TS018082190800251']


作者: 在路上_小菜鸟    时间: 2020-7-25 17:52
请问您这个问题解决了吗?onnx->rknn成功,PC模拟成功,然后加载到计算棒上面就出现你上面的那个错误
作者: leok    时间: 2020-7-27 08:27
rknn toolkit以及相关组件请升级到最新版本,1.3.2.
作者: 在路上_小菜鸟    时间: 2020-7-27 08:42
leok 发表于 2020-7-27 08:27
rknn toolkit以及相关组件请升级到最新版本,1.3.2.

已经升级了,我的计算棒API和DRV都是1.3.2  转换模型使用的rknn-toolkit1.3.2,依然出现上面的问题。




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