芯片型号:地平线J5
算法工具链:horizon_j5_open_explorer_v1.1.7
问题描述:已经借助hb_mapper_ makerbin工具将onnx模型正确量化导出为bin文件,转换过程的部分log如下:
============
Output
------------
2025-11-12 15:59:02,415 file: model_builder.py func: model_builder line No: 35 End to Horizon NN Model Convert.
2025-11-12 15:59:02,461 file: hb_mapper_makertbin.py func: hb_mapper_makertbin line No: 601 start convert to *.bin file....
2025-11-12 15:59:02,502 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4326 ONNX model output num : 1
2025-11-12 15:59:05,784 file: layout_util.py func: layout_util line No: 15 set_featuremap_layout start
model_deps_info: {'hb_mapper_version': '1.24.1', 'hbdk_version': '3.49.13', 'hbdk_runtime_version': ' 3.15.53.0', 'horizon_nn_version': '1.0.9', 'onnx_model': '/open_explorer/data/model_trans/Encoder/EncoderONNXWrapper_1013.onnx', 'march': 'bayes', 'layer_out_dump': False, 'log_level': 'DEBUG', 'working_dir': '/open_explorer/data/model_trans/Encoder/model_output_calibration', 'model_prefix': 'EncoderONNXWrapper_1013_calibration', 'input_names': ['cluster', 'edge_index', 'valid_len', 'time_step_len', 'x'], 'input_type_rt': ['featuremap', 'featuremap', 'featuremap', 'featuremap', 'featuremap'], 'input_space_and_range': ['regular', 'regular', 'regular', 'regular', 'regular'], 'input_type_train': ['featuremap', 'featuremap', 'featuremap', 'featuremap', 'featuremap'], 'input_layout_rt': ['NCHW', 'NCHW', 'NCHW', 'NCHW', 'NCHW'], 'input_layout_train': ['NCHW', 'NCHW', 'NCHW', 'NCHW', 'NCHW'], 'norm_type': ['no_preprocess', 'no_preprocess', 'no_preprocess', 'no_preprocess', 'no_preprocess'], 'scale_value': ['', '', '', '', ''], 'mean_value': ['', '', '', '', ''], 'input_shape': ['1x1x1x82', '1x1x2x65', '1x1x1x1', '1x1x1x1', '1x1x82x4'], 'input_batch': [], 'cal_dir': [], 'preprocess_on': False, 'calibration_type': 'skip', 'per_channel': 'False', 'max_percentile': 1.0, 'hbdk_params': {'hbdk_pass_through_params': '--O2 --debug --core-num 1 --fast --max-time-per-fc 1000 --jobs 8 ', 'input-source': {'x': 'ddr', 'cluster': 'ddr', 'edge_index': 'ddr', 'valid_len': 'ddr', 'time_step_len': 'ddr', '_default_value': 'ddr'}}, 'debug': True, 'compile_mode': 'latency'}
############# model deps info #############
4184 hb_mapper version : 1.24.1
4187 hbdk version : 3.49.13
4189 hbdk runtime version: 3.15.53.0
4192 horizon_nn version : 1.0.9
4196 ############# model_parameters info #############
4255 input_type_train : featuremap
4256 input_layout_train : NCHW
4257 norm_type : no_preprocess
input_shape : 1x1x1x1
---------input info : valid_len end -------
---------input info : time_step_len ---------
input_name : time_step_len
input_type_rt : featuremap
input_space&range : regular
input_layout_rt : NCHW
input_type_train : featuremap
input_layout_train : NCHW
norm_type : no_preprocess
input_shape : 1x1x1x1
---------input info : time_step_len end -------
---------input info : x ---------
input_name : x
input_type_rt : featuremap
input_space&range : regular
input_layout_rt : NCHW
input_type_train : featuremap
input_layout_train : NCHW
norm_type : no_preprocess
input_shape : 1x1x82x4
---------input info : x end -------
------------------------------------------
############# calibration_parameters info #############
preprocess_on : False
calibration_type: : skip
max_percentile : 1.0
per_channel : False
############# compiler_parameters info #############
debug : True
compile_mode : latency
hbdk_pass_through_params: --O2 --debug --core-num 1 --fast --max-time-per-fc 1000 --jobs 8
input-source {'x': 'ddr', 'cluster': 'ddr', 'edge_index': 'ddr', 'valid_len': 'ddr', 'time_step_len': 'ddr', '_default_value': 'ddr'}
hb_mapper_makertbin.py func: hb_mapper_makertbin line No: 783 Convert to runtime bin file successfully!
hb_mapper_makertbin.py func: hb_mapper_makertbin line No: 784 End Model Convert
log中显示模型的输入输出参数正常,模型转换正常
当运行hrt_model_exec model_info指令获取bin模型信息时,报出了如下错误:
../../userdata/.horizon/hrt_model_exec model_info --model_file=/system/bin/Encoder/EncoderONNXWrapper_1013_calibration.bin I0000 00:00:00.000000 18000 vlog_is_on.cc:197] RAW: Set VLOG level for "*" to 3
[BPU_PLAT]BPU Platform Version(1.3.5)!
[HBRT] set log level as 0. version = 3.15.53.0
[DNN] Runtime version = 1.24.3_(3.15.53 HBRT)
[A][DNN][packed_model.cpp:247][Model](2025-11-12,17:33:39.761.785) [HorizonRT] The model builder version = 1.24.1
[E][DNN][model.cpp:796][Model](2025-11-12,17:33:39.931.491) Invalid model, Please check if the model shape is correct! The tensor size is 0.
[E][DNN][packed_model.cpp:437][Model](2025-11-12,17:33:39.931.576) hybrid model init fail
[E][DNN][packed_model.cpp:170][Model](2025-11-12,17:33:39.981.164) Load model failed, model file:/system/bin/Encoder/EncoderONNXWrapper_1013_calibration.bin E1112 17:33:39.990409 18000 main.cpp:337] hbDNNInitializeFromFiles failed, error code:-6000002
求助一下这是什么原因?