Toybrick

I meet RKNN_ERR_MODEL_INVALID

mellon

新手上路

积分
16
发表于 2020-2-25 12:44:07    查看: 8516|回复: 6 | [复制链接]    打印 | 显示全部楼层
本帖最后由 mellon 于 2020-2-26 10:48 编辑

hello,

I convert Deeplab v3+ algorithm to rknn. rknn Build success, but in the rknn init process, I meet this error:


I [vnn_CreateRKNN:5249]Norm tensor initialize
I [vnn_CreateRKNN:5264]Const tensor initialize
I [vnn_CreateRKNN:5279]Virtual tensor initialize
I [vnn_CreateRKNN:5291]Connection initialize
I [vnn_CreateRKNN:5301]graph io initialize
D [setup_node:368]Setup node id[0] uid[100] op[VARIABLE]
D [print_tensor:136]in(0) : id[   2] vtl[0] const[1] shape[ 1, 1, 1, 1       ] fmt[f16] qnt[NONE]
D [print_tensor:136]out(0): id[ 299] vtl[1] const[0] shape[ 1, 1, 1, 1       ] fmt[f16] qnt[NONE]
D [setup_node:368]Setup node id[1] uid[105] op[VARIABLE]
D [print_tensor:136]in(0) : id[   3] vtl[0] const[1] shape[ 1, 1, 1, 1       ] fmt[f16] qnt[NONE]
D [print_tensor:136]out(0): id[ 300] vtl[1] const[0] shape[ 1, 1, 1, 1       ] fmt[f16] qnt[NONE]
D [setup_node:368]Setup node id[2] uid[111] op[VARIABLE]
D [print_tensor:136]in(0) : id[   4] vtl[0] const[1] shape[ 1, 1, 3          ] fmt[f16] qnt[NONE]
D [print_tensor:136]out(0): id[ 301] vtl[1] const[0] shape[ 1, 1, 3          ] fmt[f16] qnt[NONE]
D [setup_node:368]Setup node id[3] uid[14] op[PERMUTE]
D [print_tensor:136]in(0) : id[   1] vtl[0] const[0] shape[ 3, 224, 224, 1   ] fmt[f16] qnt[NONE]
D [print_tensor:136]out(0): id[ 302] vtl[1] const[0] shape[ 224, 224, 3, 1   ] fmt[f16] qnt[NONE]
D [setup_node:368]Setup node id[4] uid[11] op[PERMUTE]
D [print_tensor:136]in(0) : id[ 302] vtl[1] const[0] shape[ 224, 224, 3, 1   ] fmt[f16] qnt[NONE]
D [print_tensor:136]out(0): id[ 303] vtl[1] const[0] shape[ 3, 224, 224, 1   ] fmt[f16] qnt[NONE]
D [setup_node:368]Setup node id[5] uid[120] op[RESHAPE]
D [print_tensor:136]in(0) : id[ 303] vtl[1] const[0] shape[ 3, 224, 224, 1   ] fmt[f16] qnt[NONE]
D [print_tensor:136]out(0): id[ 304] vtl[1] const[0] shape[ 3, 224, 224      ] fmt[f16] qnt[NONE]
D [setup_node:368]Setup node id[6] uid[116] op[SUBTRACT]
E [op_check:98]Invalid broadcast for inputs[1] size[3]
E [setup_node:383]Check node[6] SUBTRACT fail
I [remove_client_ops:4942]remove_client_ops num=0
I [remove_client_ops:4953]remove_client_ops finish
Create RKNN model fail!
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_MODEL_INVALID
Init runtime environment failed



How can i slove this problem? I used rknn-toolkit version 1.3.0, and tensorflow version is 1.14.0. python version is 3.6.

I convert this model. (https://github.com/tensorflow/mo ... /g3doc/model_zoo.md, xception65_coco_voc_trainval)

By any chance, rknn does not support sub operations?



Thank you.


回复

使用道具 举报

jefferyzhang

版主

积分
12848
发表于 2020-2-26 08:34:59 | 显示全部楼层
Thanks for your report. I have sent it to NPU team.
If there is any process, I will inform you in time.

Sub op in tensorflow will be packaged in other sub graph, it is hard to identity the problem without NPU team.
You may take a try about customize op function which was described in document.
回复

使用道具 举报

mellon

新手上路

积分
16
 楼主| 发表于 2020-2-27 11:01:46 | 显示全部楼层
jefferyzhang 发表于 2020-2-26 08:34
Thanks for your report. I have sent it to NPU team.
If there is any process, I will inform you in ti ...

Ok. i will do my best. plz Send me reply as soon as possible.
回复

使用道具 举报

jefferyzhang

版主

积分
12848
发表于 2020-2-28 16:43:12 | 显示全部楼层
本帖最后由 jefferyzhang 于 2020-2-28 17:42 编辑

NPU team need some infomations as below:
Where did you running this model, simulator or device?
If in device, please check NPU driver version.
回复

使用道具 举报

wali

注册会员

积分
72
发表于 2020-4-15 23:26:33 | 显示全部楼层
本帖最后由 wali 于 2020-4-15 23:28 编辑
  1. D [print_tensor:136]out(0): id[ 195] vtl[1] const[0] shape[ 32, 32, 256, 1   ] fmt[u8 ] qnt[ASM zp=114, scale=0.014985]
  2. D [setup_node:368]Setup node id[58] uid[156] op[RELU]
  3. D [print_tensor:136]in(0) : id[ 193] vtl[1] const[0] shape[ 32, 32, 256, 1   ] fmt[u8 ] qnt[ASM zp=  0, scale=0.007946]
  4. D [print_tensor:136]out(0): id[ 196] vtl[1] const[0] shape[ 32, 32, 256, 1   ] fmt[u8 ] qnt[ASM zp=  0, scale=0.007946]
  5. D [setup_node:368]Setup node id[59] uid[108] op[DECONVOLUTION]
  6. D [print_tensor:136]in(0) : id[ 194] vtl[1] const[0] shape[ 64, 64, 64, 1    ] fmt[u8 ] qnt[ASM zp=  0, scale=0.007091]
  7. D [print_tensor:136]in(1) : id[  50] vtl[0] const[1] shape[ 5, 5, 64, 64     ] fmt[u8 ] qnt[ASM zp=111, scale=0.009331]
  8. D [print_tensor:136]in(2) : id[  51] vtl[0] const[1] shape[ 64               ] fmt[i32] qnt[ASM zp=  0, scale=0.000066]
  9. D [print_tensor:136]out(0): id[ 197] vtl[1] const[0] shape[ 131, 131, 64, 1  ] fmt[u8 ] qnt[ASM zp= 62, scale=0.055957]
  10. D [setup_node:368]Setup node id[60] uid[145] op[CONV2D]
  11. D [print_tensor:136]in(0) : id[ 196] vtl[1] const[0] shape[ 32, 32, 256, 1   ] fmt[u8 ] qnt[ASM zp=  0, scale=0.007946]
  12. D [print_tensor:136]in(1) : id[  52] vtl[0] const[1] shape[ 3, 3, 256, 256   ] fmt[u8 ] qnt[ASM zp=151, scale=0.002047]
  13. D [print_tensor:136]in(2) : id[  53] vtl[0] const[1] shape[ 256              ] fmt[i32] qnt[ASM zp=  0, scale=0.000016]
  14. D [print_tensor:136]out(0): id[ 198] vtl[1] const[0] shape[ 32, 32, 256, 1   ] fmt[u8 ] qnt[ASM zp=143, scale=0.019981]
  15. D [setup_node:368]Setup node id[61] uid[109] op[SLICE]
  16. D [print_tensor:136]in(0) : id[ 197] vtl[1] const[0] shape[ 131, 131, 64, 1  ] fmt[u8 ] qnt[ASM zp= 62, scale=0.055957]
  17. D [print_tensor:136]out(0): id[ 199] vtl[1] const[0] shape[ 64, 128, 128, 4  ] fmt[u8 ] qnt[ASM zp= 62, scale=0.055957]
  18. D [setup_node:368]Setup node id[62] uid[120] op[ADD]
  19. D [print_tensor:136]in(0) : id[ 198] vtl[1] const[0] shape[ 32, 32, 256, 1   ] fmt[u8 ] qnt[ASM zp=143, scale=0.019981]
  20. D [print_tensor:136]in(1) : id[ 195] vtl[1] const[0] shape[ 32, 32, 256, 1   ] fmt[u8 ] qnt[ASM zp=114, scale=0.014985]
  21. D [print_tensor:136]out(0): id[ 200] vtl[1] const[0] shape[ 32, 32, 256, 1   ] fmt[u8 ] qnt[ASM zp=144, scale=0.024428]
  22. D [setup_node:368]Setup node id[63] uid[97] op[ADD]
  23. E [op_check:103]Invalid broadcast for inputs[0] size[64]
  24. E [setup_node:383]Check node[63] ADD fail
  25. Segmentation fault (core dumped)
复制代码
API Version:1.3.0Driver Version : 1.3.1
在PC上运行遇到了相同的问题,在混合量化自己模型的时候 !不混合量化是没问题的!
在RKPro上报以下错误:
  1. I NPUTransfer: Starting NPU Transfer Client, Transfe
  2. r version 1.9.8 (cab3961@2019-12-12T09:54:26)
  3. D NPUTransfer: Transfer spec = local:transfer_proxy
  4. D NPUTransfer: Transfer interface successfully opene
  5. d, fd = 9
  6. E RKNNAPI: rknn_init,  msg_load_ack fail, ack = 1(ACK_FAIL), expect 0(ACK_SUCC)!
  7. E RKNNAPI: ==============================================
  8. E RKNNAPI: RKNN VERSION:
  9. E RKNNAPI:   API: 1.3.0 (c5654ea build: 2019-12-25 12:40:55)
  10. E RKNNAPI:   DRV: 1.3.1 (6ebb4d7 build: 2020-01-02 09:37:58)
  11. E RKNNAPI: ==============================================
  12. D NPUTransfer: Transfer client closed, fd = 9
  13. E Catch exception when init runtime!
  14. E Traceback (most recent call last):
  15. E   File "rknn/api/rknn_base.py", line 988, in rknn.api.rknn_base.RKNNBase.init_runtime
  16. E   File "rknn/api/rknn_runtime.py", line 320, in rknn.api.rknn_runtime.RKNNRuntime.build_graph
  17. E Exception: RKNN init failed. error code: RKNN_ERR_MODEL_INVALID
  18. Init runtime environment failed!
复制代码


回复

使用道具 举报

apupu

注册会员

积分
115
发表于 2020-7-1 15:07:32 | 显示全部楼层
wali 发表于 2020-4-15 23:26
API Version:1.3.0Driver Version : 1.3.1
在PC上运行遇到了相同的问题,在混合量化自己模型的时候 !不 ...

你好,请问你的问题解决了吗?how?
回复

使用道具 举报

tf小迷弟

注册会员

积分
61
发表于 2021-1-6 10:41:45 | 显示全部楼层
mellon 发表于 2020-2-27 11:01
Ok. i will do my best. plz Send me reply as soon as possible.

If you have any process,plz inform me of it.It's a great honor to get your help.
回复

使用道具 举报

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

本版积分规则

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


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