Toybrick

Yolov5s模型build, 设置 pre_compile=True, rknn.init_runtime()报错

theantbully

注册会员

积分
63
楼主
发表于 2021-9-1 20:13:01    查看: 3283|回复: 3 | [复制链接]    打印 | 只看该作者
模型为Yolov5s来源于官网:https://github.com/ultralytics/yolov5/ matser 分支, 转换的toolkit为rknn-1.7.0

设置 pre-compile=True, 可导出rknn模型文件,但是init_runtime()报错:
I [vnn_CreateRKNN:6025]Virtual tensor initialize
I [vnn_CreateRKNN:6037]Connection initialize
I [vnn_CreateRKNN:6047]graph io initialize
D [setup_node:441]Setup node id[0] uid[0] op[NBG] name[nbg_0]
D [print_tensor:146]in(0) : id[   3] vtl[0] const[0] shape[ 640, 640, 3, 1   ] fmt[f16] qnt[NONE]
D [print_tensor:146]out(0): id[   0] vtl[0] const[0] shape[ 80, 80, 85, 3, 1 ] fmt[u8 ] qnt[ASM zp=210, scale=0.092896]
D [print_tensor:146]out(1): id[   1] vtl[0] const[0] shape[ 40, 40, 85, 3, 1 ] fmt[u8 ] qnt[ASM zp=182, scale=0.086178]
D [print_tensor:146]out(2): id[   2] vtl[0] const[0] shape[ 20, 20, 85, 3, 1 ] fmt[u8 ] qnt[ASM zp=179, scale=0.075776]
D [optimize_node:385]Backward optimize neural network
D [optimize_node:392]Forward optimize neural network
I [compute_node:327]Create vx node
D [compute_node:350]Instance node[0] "NBG" ...
E [compute_node:354]Create node[0] NBG fail
Create rknn graph fail!
Warning: NN VipSram is NULL, but SRAM is enabled!  ##  这是什么警告 ??
I [remove_client_ops:5508]remove_client_ops num=0
I [remove_client_ops:5519]remove_client_ops finish
Create RKNN model fail, error=-6
E Catch exception when init runtime!
E Traceback (most recent call last):
E   File "rknn/api/rknn_base.py", line 884, in rknn.api.rknn_base.RKNNBase.init_runtime
E   File "rknn/api/rknn_runtime.py", line 341, in rknn.api.rknn_runtime.RKNNRuntime.build_graph
E Exception: RKNN init failed. error code: RKNN_ERR_MODEL_INVALID
Init runtime environment failed

当设置 pre-compile=False,模型load很慢,但结果正确;

我需要设置pre_compile=True, 因为模型load会快很多,哪位大佬知道这个错误是为什么?


回复

使用道具 举报

theantbully

注册会员

积分
63
沙发
 楼主| 发表于 2021-9-2 09:01:59 | 只看该作者
这是再PC机器上做的转换
回复

使用道具 举报

theantbully

注册会员

积分
63
板凳
 楼主| 发表于 2021-9-2 09:32:46 | 只看该作者
rknn.init_runtime 是必须要在开发板上面进行吗?在PC上只调用init_runtime, 不进行inference是否可行?
回复

使用道具 举报

theantbully

注册会员

积分
63
地板
 楼主| 发表于 2021-9-2 09:48:52 | 只看该作者
自问自答
当 pre_compile=True, 既不能在PC上init_runtime, 也不能 inference.
回复

使用道具 举报

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

本版积分规则

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


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