Toybrick

Create RKNN model fail! RKNN init failed. error code: RKNN_ERR_MODEL_INVALID

byhang

新手上路

积分
28
发表于 2020-11-7 17:36:07    查看: 489|回复: 2 | [复制链接]    打印 | 显示全部楼层
--> Loading model
done
--> config model
done
--> Building model
W The target_platform is not set in config, using default target platform rk1808.
W The channel_mean_value filed will not be used in the future!
/home/byhang/rknn/lib/python3.5/site-packages/rknn/api/rknn.py:249: RuntimeWarning: invalid value encountered in true_divide
  ret = self.rknn_base.build(do_quantization=do_quantization, dataset=dataset, pack_vdata=pre_compile, batch_size=rknn_batch_size)
done
--> Export RKNN model
done
--> Init runtime environment
E [vnn_CreateRKNN:5109]load_json:Error before: Infinity, "zero_point": 0, "qnt_type": "RKNN_QNT_TYPE_AFFINE_ASYMMETRIC", "vx_type": "RKNN_TYPE_INT32"}, "offset": 64052200, "len": 512}, {"tensor_id": 58, "size": [3, 3, 128, 128], "dim_num": 4, "dtype": {"scale": 0.005261368, "zero_point": 141, "qnt_type": "RKNN_QNT_TYPE_AFFINE_ASYMMETRIC", "vx_type": "RKNN_TYPE_UINT8"}, "offset": 1504, "len": 147456}, {"tensor_id": 59, "size": [128], "dim_num": 1, "dtype": {"scale": Infinity, "zero_point": 0, "qnt_type": "RKNN_QNT_TYPE_AFFINE_ASYMMETRIC", "vx_type": "RKNN_TYPE_INT32"}, "offset": 992, "len": 512}, {"tensor_id": 60, "size": [1, 1, 128, 128], "dim_num": 4, "dtype": {"scale": 4.818612099, "zero_point": 244, "qnt_type": "RKNN_QNT_TYPE_AFFINE_ASYMMETRIC", "vx_type": "RKNN_TYPE_UINT8"}, "offset": 149472, "len": 16384}, {"tensor_id": 61, "size": [128], "dim_num": 1, "dtype": {"scale": Infinity, "zero_point": 0, "qnt_type": "RKNN_QNT_TYPE_AFFINE_ASYMMETRIC", "vx_type": "RKNN_TYPE_INT32"}, "offset":
Create RKNN model fail!
E Catch exception when init runtime!
E Traceback (most recent call last):
E   File "rknn/api/rknn_base.py", line 1154, in rknn.api.rknn_base.RKNNBase.init_runtime
E   File "rknn/api/rknn_runtime.py", line 356, in rknn.api.rknn_runtime.RKNNRuntime.build_graph
E Exception: RKNN init failed. error code: RKNN_ERR_MODEL_INVALID
Init runtime environment failed

大佬大佬,我自己训练的darknet模型,量化时有warning,有rknn模型输出,但Init runtime environment failed,错误信息是从库里报出的,我跟不到,现在无从下手,求救啊!!!
模型文件61.3MB
链接: https://pan.baidu.com/s/150SlWi2smWB96djuILw2kg 提取码: ydws 复制这段内容后打开百度网盘手机App,操作更方便哦

回复

使用道具 举报

raul

中级会员

积分
215
发表于 2020-11-9 11:38:10 | 显示全部楼层
从模型来看,是在计算量化参数的时候出现了问题了,算出来的scale是无限大的一个值,所以如果要分析的话,需要有原始模型。只给个rknn模型没法继续分析。
回复

使用道具 举报

byhang

新手上路

积分
28
 楼主| 发表于 2020-11-10 10:52:04 | 显示全部楼层
本帖最后由 byhang 于 2020-11-11 15:38 编辑
raul 发表于 2020-11-9 11:38
从模型来看,是在计算量化参数的时候出现了问题了,算出来的scale是无限大的一个值,所以如果要分析的话, ...
E   File "rknn/base/RKNNlib/converter/convert_pytorch.py", line 159, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.__ir_shape_inference
E   File "rknn/base/RKNNlib/converter/convert_pytorch.py", line 212, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.list_construct_shape
E   File "rknn/base/RKNNlib/converter/convert_pytorch.py", line 124, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.shape_pick
E   File "rknn/base/RKNNlib/converter/convert_pytorch.py", line 159, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.__ir_shape_inference
E   File "rknn/base/RKNNlib/converter/convert_pytorch.py", line 449, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.upsample_nearest2d_shape
E   File "rknn/base/RKNNlib/converter/convert_pytorch.py", line 142, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.tensor_inference
E   File "rknn/base/RKNNlib/converter/convert_pytorch.py", line 683, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.prim_ListConstruct
E   File "rknn/base/RKNNlib/converter/convert_pytorch.py", line 146, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.tensor_inference
E   File "rknn/base/RKNNlib/converter/convert_pytorch.py", line 723, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.value_cast
E   File "rknn/base/RKNNlib/converter/convert_pytorch.py", line 712, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.value_cast.lambda
E TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
Load original model failed!
回复

使用道具 举报

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

本版积分规则

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


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