Toybrick

标题: error code: RKNN_ERR_DEVICE_UNAVAILABLE, rknn 模型推理时无法 init_runtime [打印本页]

作者: kkkaaa    时间: 2020-5-11 16:00
标题: error code: RKNN_ERR_DEVICE_UNAVAILABLE, rknn 模型推理时无法 init_runtime
从 pytorch 转 rknn, 转化成功,rknn 模型推理时报错
--> Init runtime environment
I NPUTransfer: Starting NPU Transfer Client, Transfer version 1.9.8 (cab3961@2019-12-12T09:54:26)
E RKNNAPI: rknn_init,  recv(MsgLoadAck) fail, -9(ERROR_PIPE) != 368!
E Catch exception when init runtime!
E Traceback (most recent call last):
E   File "rknn/api/rknn_base.py", line 988, in rknn.api.rknn_base.RKNNBase.init_runtime
E   File "rknn/api/rknn_runtime.py", line 320, in rknn.api.rknn_runtime.RKNNRuntime.build_graph
E Exception: RKNN init failed. error code: RKNN_ERR_DEVICE_UNAVAILABLE
Init runtime environment failed

------------
在同一个开发板上,加载另一个 rknn 模型可以正常 init_runtime, 虽然会报另一个错,如下
--> Init runtime environment
I NPUTransfer: Starting NPU Transfer Client, Transfer version 1.9.8 (cab3961@2019-12-12T09:54:26)
D RKNNAPI: ==============================================
D RKNNAPI: RKNN VERSION:
D RKNNAPI:   API: 1.3.0 (c5654ea build: 2019-12-25 12:40:55)
D RKNNAPI:   DRV: 1.3.1 (6ebb4d7 build: 2020-01-02 09:37:58)
D RKNNAPI: ==============================================
done
--> Running model
W RKNNAPI: warning: inputs[0] expected input len is 16384, but actual len is 262144!
W RKNNAPI: warning: inputs[1] expected input len is 1024, but actual len is 65536!
E RKNNAPI: rknn_input_set,  inputs[2].buf wrong, buf = 0x3f656160, size = 65536 (min_size = 262144)!
E Catch exception when setting inputs.
E Traceback (most recent call last):
E   File "rknn/api/rknn_base.py", line 1109, in rknn.api.rknn_base.RKNNBase.inference
E   File "rknn/api/rknn_base.py", line 998, in rknn.api.rknn_base.RKNNBase.set_inputs
E   File "rknn/api/rknn_runtime.py", line 422, in rknn.api.rknn_runtime.RKNNRuntime.set_inputs
E Exception: Set inputs failed. error code: RKNN_ERR_PARAM_INVALID
Traceback (most recent call last):
  File "Regressor_experimanet_rknn_from_onnx_runtime.py", line 50, in <module>
    print('rknn_outputs length: ', len(rknn_outputs))
TypeError: object of type 'NoneType' has no len()


作者: kkkaaa    时间: 2020-5-11 19:42
本帖最后由 kkkaaa 于 2020-5-11 20:00 编辑

找到原因了
这是一个多输入模型,参考帖子:http://t.rock-chips.com/forum.ph ... 1308&extra=page%3D9
是转化的时候 rknn.load_pytorch(model=..., input_size_list=...) input_size_list 不应该包含 batch 维




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