airockchip / rknn-toolkit2

Other
1.02k stars 106 forks source link

onnx转rknn报错 #221

Open kuangcaomvp opened 2 days ago

kuangcaomvp commented 2 days ago

今天尝试吧HIT模型转换成rknn的时候报了以下错误,请问是什么原因导致的 环境: python 3.10 rknn-toolkit2 version: 2.3.0

报错信息如下:

--> Building model D base_optimize ... D base_optimize done. D D fold_constant ... D fold_constant done. D fold_constant remove nodes = ['/conv5_br/Conv', '/conv4_br/conv4_br.2/Relu', '/conv4_br/conv4_br.0/Conv', '/conv3_br/conv3_br.2/Relu', '/conv3_br/conv3_br.0/Conv', '/conv2_br/conv2_br.2/Relu', '/conv2_br/conv2_br.0/Conv', '/conv1_br/conv1_br.2/Relu', '/conv1_br/conv1_br.0/Conv', '/conv5_tl/Conv', '/conv4_tl/conv4_tl.2/Relu', '/conv4_tl/conv4_tl.0/Conv', '/conv3_tl/conv3_tl.2/Relu', '/conv3_tl/conv3_tl.0/Conv', '/conv2_tl/conv2_tl.2/Relu', '/conv2_tl/conv2_tl.0/Conv', '/conv1_tl/conv1_tl.2/Relu', '/conv1_tl/conv1_tl.0/Conv'] E build: All outputs ['tl', 'br'] of model are constants, The model is invalid! Please check if the original model is valid? W build: ===================== WARN(2) ===================== E rknn-toolkit2 version: 2.3.0 E build: Traceback (most recent call last): File "rknn/api/rknn_log.py", line 344, in rknn.api.rknn_log.error_catch_decorator.error_catch_wrapper File "rknn/api/rknn_base.py", line 1945, in rknn.api.rknn_base.RKNNBase.build File "rknn/api/graph_optimizer.py", line 1103, in rknn.api.graph_optimizer.GraphOptimizer.fold_constant File "rknn/api/rknn_log.py", line 95, in rknn.api.rknn_log.RKNNLog.e ValueError: All outputs ['tl', 'br'] of model are constants, The model is invalid! Please check if the original model is valid?

I ===================== WARN(0) ===================== E rknn-toolkit2 version: 2.3.0 Traceback (most recent call last): File "rknn/api/rknn_log.py", line 344, in rknn.api.rknn_log.error_catch_decorator.error_catch_wrapper File "rknn/api/rknn_base.py", line 1945, in rknn.api.rknn_base.RKNNBase.build File "rknn/api/graph_optimizer.py", line 1103, in rknn.api.graph_optimizer.GraphOptimizer.fold_constant File "rknn/api/rknn_log.py", line 95, in rknn.api.rknn_log.RKNNLog.e ValueError: All outputs ['tl', 'br'] of model are constants, The model is invalid! Please check if the original model is valid?

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/data/code/ostrack/rknn/hit_test/video_demo_rknn.py", line 343, in main() File "/data/code/ostrack/rknn/hit_test/video_demo_rknn.py", line 339, in main run_video(args.tracker_path, args.videofile) File "/data/code/ostrack/rknn/hit_test/video_demo_rknn.py", line 227, in run_video ret = rknn.build(do_quantization=False, dataset=None) File "/data/anaconda3/envs/py10/lib/python3.10/site-packages/rknn/api/rknn.py", line 192, in build return self.rknn_base.build(do_quantization=do_quantization, dataset=dataset, expand_batch_size=rknn_batch_size) File "rknn/api/rknn_log.py", line 349, in rknn.api.rknn_log.error_catch_decorator.error_catch_wrapper File "rknn/api/rknn_log.py", line 95, in rknn.api.rknn_log.RKNNLog.e ValueError: Traceback (most recent call last): File "rknn/api/rknn_log.py", line 344, in rknn.api.rknn_log.error_catch_decorator.error_catch_wrapper File "rknn/api/rknn_base.py", line 1945, in rknn.api.rknn_base.RKNNBase.build File "rknn/api/graph_optimizer.py", line 1103, in rknn.api.graph_optimizer.GraphOptimizer.fold_constant File "rknn/api/rknn_log.py", line 95, in rknn.api.rknn_log.RKNNLog.e ValueError: All outputs ['tl', 'br'] of model are constants, The model is invalid! Please check if the original model is valid?

image

fold_constant remove nodes是不是把不支持的节点给删除了 导致的 ?但是这些节点都是正常的conv和relu,有没有什么方法可以定位具体的报错信息

kuangcaomvp commented 2 days ago

通过百度网盘分享的文件:VT_ep1500.onnx 链接:https://pan.baidu.com/s/1-Y6IQVei6ePrWwQsqiC3dA 提取码:r6ph 我的onnx