rknn-toolkit2 icon indicating copy to clipboard operation
rknn-toolkit2 copied to clipboard

onnx量化转rknn报错

Open chenzhy223 opened this issue 1 year ago • 3 comments

在python3.8环境中,用下面的代码把ppyoloe转化固定shape的onnx模型量化转为rknn报错:

Build model

print('--> Building model') ret = rknn.build(do_quantization=True, dataset=DATASET) #量化,会报错

ret = rknn.build(do_quantization=False, dataset=DATASET) #不量化,不报错,能够转化

if ret != 0: print('build model failed.') exit(ret) print('done') 报错信息为: ................................ I sparse_weight ... E build: Unsupport file #! W build: ===================== WARN(5) ===================== E rknn-toolkit2 version: 1.5.2+b642f30c E build: Catch exception when building RKNN model! E build: Traceback (most recent call last): E build: File "rknn/api/rknn_base.py", line 1974, in rknn.api.rknn_base.RKNNBase.build E build: File "rknn/api/graph_optimizer.py", line 2377, in rknn.api.graph_optimizer.GraphOptimizer.sparse_weight E build: File "rknn/api/sparse_weight.py", line 528, in rknn.api.sparse_weight.sparse_weight E build: File "rknn/api/sparse_weight.py", line 75, in rknn.api.sparse_weight._range_input E build: File "rknn/api/rknn_log.py", line 112, in rknn.api.rknn_log.RKNNLog.e E build: ValueError: Unsupport file #! W If you can't handle this error, please try updating to the latest version of the toolkit2 and runtime from: https://eyun.baidu.com/s/3eTDMk6Y (Pwd: rknn) Path: RK_NPU_SDK / RK_NPU_SDK_1.X.0 / develop / If the error still exists in the latest version, please collect the corresponding error logs and the model, convert script, and input data that can reproduce the problem, and then submit an issue on: https://redmine.rock-chips.com (Please consult our sales or FAE for the redmine account) build model failed.

安装了最新版本的rknn-toolkit2-1.5.3b8也是不行,也是这个错误

chenzhy223 avatar Nov 25 '23 10:11 chenzhy223

提供一下你原始onnx模型和转化固定shape的onnx模型

wyd520520 avatar Nov 27 '23 02:11 wyd520520

提供一下你原始onnx模型和转化固定shape的onnx模型

全部的文件都在这里了,构建的具体conda环境在Paddle2Rknn.yaml文件中 链接:https://pan.baidu.com/s/1pS2hkYeL7Ie-dGzhHNd7tg?pwd=cw95 提取码:cw95 --来自百度网盘超级会员V1的分享

chenzhy223 avatar Nov 27 '23 03:11 chenzhy223

请问解决了吗

Strange-mzi avatar Nov 29 '23 08:11 Strange-mzi