量化后.bin的模型与原始.onnx模型精度出现很大偏差,模型输出语义信息和深度信息。

问题现象:1. 深度信息模型输出:从原始模型.onnx ---------> *_quantized_model.onnx 量化模型基本无法偏差;从量化模型-------> 部署模型.bin 精度失真严重 2. 语义分割模型输出:从原始模型.onnx ---------> *_calibrated_model.onnx 标定模型出现偏差;已仔细校验过数据预处理部分,模型校验数据来自训练集经过预处理后的数据。

希望能提供指导意见,下步应该怎么去优化这个精度问题?

转换配置文件如下:

model_parameters:
  onnx_model: '../lraspp_99_torch110.onnx'
  march: 'bayes-e'
  output_model_file_prefix: 'lraspp_99_torch110_3'
  working_dir: '../hb_mapper_output_3/lraspp_99_torch110_3'
  layer_out_dump: False

  node_info: {
    "Conv_16": {'ON': 'CPU'},
    "Conv_14": {'ON': 'CPU'},
    "Conv_12": {'ON': 'CPU'},
    "Conv_9": {'ON': 'CPU'},
    "Conv_170": {'ON': 'BPU', 'InputType': 'int16', 'OutputType': 'int16'},
    "Conv_171": {'ON': 'BPU', 'InputType': 'int16', 'OutputType': 'int16'},
    "Resize_220": {'ON': 'CPU'},
    "Resize_229": {'ON': 'CPU'},
    "Where_263_add": {'ON': 'CPU'},
    "Where_340_add": {'ON': 'CPU'},
    "ScatterND_337": {'ON': 'CPU'},
    "ScatterND_414": {'ON': 'CPU'},
  }

input_parameters:
  input_name: 'input'
  # 当前最新模型真实输入不是纯 RGB,而是 5 通道 featuremap:
  #   0~2: RGB,已做 (x/255 - mean) / std
  #   3  : radar_range,先按 sensor_depth_max 解码到米制,再按 [depth_min, depth_max]
  #        截断并线性归一化到 [0, 1]
  #   4  : radar_valid_mask,取值 {0, 1}
  # 该输入口径必须与 export_onnx.py、test_and_visualize_onnx.py、
  # test_and_visualize_RDK_X5.py 保持完全一致。
  input_type_train: 'featuremap'
  input_layout_train: 'NCHW'
  input_type_rt: 'featuremap'
  input_layout_rt: 'NCHW'
  input_shape: '1x5x360x640'
  input_batch: 1

  # featuremap 输入要求上板前已经完成全部前处理,因此这里不能再走 rgb/nv12 预处理链
  norm_type: 'no_preprocess'

calibration_parameters:
  # 正式 PTQ 时,这里需要放“预处理后的 5 通道 float32 featuremap 校准数据”
  # 数据口径必须与 input_type_train/input_layout_train/input_shape 完全一致
  # 即每个样本都是 row-major 的 float32 二进制,shape = 1x5x360x640 或 5x360x640
  # 当前 featuremap 生成逻辑应与 02_generate_calibration_data.py 的最新版本一致。
  cal_data_dir: '../hb_calibration_data1_f32'
  cal_data_type: 'float32'
  preprocess_on: False
  per_channel: True
  # 如果已经准备好了代表性的最新 featuremap 校准集,建议保持 'default' 做正式 PTQ; 'skip'
  calibration_type: 'max'  
  max_percentile: 0.9999

compiler_parameters:
  compile_mode: 'latency'
  debug: False
  core_num: 1
  optimize_level: 'O3'
  # featuremap 输入通常从 DDR 喂入
  input_source: {'input': 'ddr'}

模型转换makertbin日志log:

2026-04-21 18:10:16,405 file: tool_utils.py func: tool_utils line No: 77 log will be stored in /open_explorer/test_lraspp_model_0421/hb_mapper_makertbin.log
2026-04-21 18:10:16,405 file: hb_mapper.py func: hb_mapper line No: 132 Start hb_mapper....
2026-04-21 18:10:16,405 file: hb_mapper.py func: hb_mapper line No: 133 hbdk version 3.49.15
2026-04-21 18:10:16,405 file: hb_mapper.py func: hb_mapper line No: 134 horizon_nn version 1.1.0
2026-04-21 18:10:16,405 file: hb_mapper.py func: hb_mapper line No: 135 hb_mapper version 1.24.3
2026-04-21 18:10:16,405 file: hb_mapper_makertbin.py func: hb_mapper_makertbin line No: 530 Start Model Convert....
2026-04-21 18:10:16,411 file: mapper_conf_parser.py func: mapper_conf_parser line No: 105 validating model_parameters...
2026-04-21 18:10:16,411 file: mapper_conf_parser.py func: mapper_conf_parser line No: 1347 Using abs path /open_explorer/test_lraspp_model_0421/lraspp_99_torch110.onnx
2026-04-21 18:10:16,412 file: mapper_conf_parser.py func: mapper_conf_parser line No: 260 Using onnx model file: /open_explorer/test_lraspp_model_0421/lraspp_99_torch110.onnx
2026-04-21 18:10:16,424 file: onnx_parser.py func: onnx_parser line No: 39 Model input names: ['input']
2026-04-21 18:10:16,424 file: mapper_conf_parser.py func: mapper_conf_parser line No: 264 Model has 1 inputs according to model file
2026-04-21 18:10:16,424 file: mapper_conf_parser.py func: mapper_conf_parser line No: 1347 Using abs path /open_explorer/test_lraspp_model_0421/hb_mapper_output_3/lraspp_99_torch110_3
2026-04-21 18:10:16,424 file: mapper_conf_parser.py func: mapper_conf_parser line No: 287 working_dir does not exist. Creating working_dir: /open_explorer/test_lraspp_model_0421/hb_mapper_output_3/lraspp_99_torch110_3
2026-04-21 18:10:16,424 file: mapper_conf_parser.py func: mapper_conf_parser line No: 438 node_dict: {self.node_dict}
2026-04-21 18:10:16,425 file: mapper_conf_parser.py func: mapper_conf_parser line No: 119 validating model_parameters finished
2026-04-21 18:10:16,425 file: mapper_conf_parser.py func: mapper_conf_parser line No: 123 validating input_parameters...
2026-04-21 18:10:16,425 file: mapper_conf_parser.py func: mapper_conf_parser line No: 135 validating input_parameters finished
2026-04-21 18:10:16,425 file: mapper_conf_parser.py func: mapper_conf_parser line No: 139 validating calibration_parameters...
2026-04-21 18:10:16,425 file: mapper_conf_parser.py func: mapper_conf_parser line No: 1347 Using abs path /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32
2026-04-21 18:10:16,425 file: mapper_conf_parser.py func: mapper_conf_parser line No: 1013 The calibration dir name suffix is the same as the value float32 of the cal_data_type parameter and will be read with the value of cal_data_type.
2026-04-21 18:10:16,425 file: mapper_conf_parser.py func: mapper_conf_parser line No: 155 validating calibration_parameters finished
2026-04-21 18:10:16,425 file: mapper_conf_parser.py func: mapper_conf_parser line No: 159 validating custom_op...
2026-04-21 18:10:16,425 file: mapper_conf_parser.py func: mapper_conf_parser line No: 1076 custom_op does not exist, skipped
2026-04-21 18:10:16,425 file: mapper_conf_parser.py func: mapper_conf_parser line No: 165 validating custom_op finished
2026-04-21 18:10:16,425 file: mapper_conf_parser.py func: mapper_conf_parser line No: 168 validating compiler_parameters...
2026-04-21 18:10:16,425 file: mapper_conf_parser.py func: mapper_conf_parser line No: 183 validating compiler_parameters finished
2026-04-21 18:10:16,425 file: mapper_conf_parser.py func: mapper_conf_parser line No: 187 validating deprecated parameters...
2026-04-21 18:10:16,425 file: mapper_conf_parser.py func: mapper_conf_parser line No: 193 validating deprecated parameters finished
2026-04-21 18:10:16,425 file: hb_mapper_makertbin.py func: hb_mapper_makertbin line No: 54 Dump config:
2026-04-21 18:10:16,425 file: hb_mapper_makertbin.py func: hb_mapper_makertbin line No: 55 calibration_parameters:
  cal_data_dir: ../hb_calibration_data1_f32
  cal_data_type: float32
  calibration_type: max
  max_percentile: 0.9999
  per_channel: true
  preprocess_on: false
compiler_parameters:
  compile_mode: latency
  core_num: 1
  debug: false
  input_source:
    input: ddr
  optimize_level: O3
input_parameters:
  input_batch: '1'
  input_layout_rt: NCHW
  input_layout_train: NCHW
  input_name: input
  input_shape: 1x5x360x640
  input_type_rt: featuremap
  input_type_train: featuremap
  norm_type: no_preprocess
model_parameters:
  layer_out_dump: false
  march: bayes-e
  node_info:
    Conv_12:
      'ON': CPU
    Conv_14:
      'ON': CPU
    Conv_16:
      'ON': CPU
    Conv_170:
      InputType: int16
      'ON': BPU
      OutputType: int16
    Conv_171:
      InputType: int16
      'ON': BPU
      OutputType: int16
    Conv_9:
      'ON': CPU
    Resize_220:
      'ON': CPU
    Resize_229:
      'ON': CPU
    ScatterND_337:
      'ON': CPU
    ScatterND_414:
      'ON': CPU
    Where_263_add:
      'ON': CPU
    Where_340_add:
      'ON': CPU
  onnx_model: ../lraspp_99_torch110.onnx
  output_model_file_prefix: lraspp_99_torch110_3
  working_dir: ../hb_mapper_output_3/lraspp_99_torch110_3

2026-04-21 18:10:16,430 file: hb_mapper_makertbin.py func: hb_mapper_makertbin line No: 60 input 'input' : original model shape: [1, 5, 360, 640]
2026-04-21 18:10:16,430 file: loader.py func: loader line No: 204 *******************************************
2026-04-21 18:10:16,430 file: loader.py func: loader line No: 205 First calibration picture name: scene_001_38.bin
2026-04-21 18:10:16,430 file: loader.py func: loader line No: 207 First calibration picture md5:
2026-04-21 18:10:16,439 file: loader.py func: loader line No: 211 *******************************************
2026-04-21 18:10:16,439 file: loader.py func: loader line No: 282 created RawImageDirLoader of shape:[1, 5, 360, 640]
2026-04-21 18:10:16,439 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_001_38.bin
2026-04-21 18:10:16,442 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_002_31.bin
2026-04-21 18:10:16,443 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_002_33.bin
2026-04-21 18:10:16,445 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_003_43.bin
2026-04-21 18:10:16,446 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_003_57.bin
2026-04-21 18:10:16,448 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_004_44.bin
2026-04-21 18:10:16,450 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_005_11.bin
2026-04-21 18:10:16,451 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_006_00.bin
2026-04-21 18:10:16,453 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_007_24.bin
2026-04-21 18:10:16,454 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_008_32.bin
2026-04-21 18:10:16,456 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_009_50.bin
2026-04-21 18:10:16,457 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_011_17.bin
2026-04-21 18:10:16,459 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_012_05.bin
2026-04-21 18:10:16,460 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_013_10.bin
2026-04-21 18:10:16,462 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_014_36.bin
2026-04-21 18:10:16,464 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_015_47.bin
2026-04-21 18:10:16,466 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_016_53.bin
2026-04-21 18:10:16,467 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_017_56.bin
2026-04-21 18:10:16,469 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_018_20.bin
2026-04-21 18:10:16,470 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_019_19.bin
2026-04-21 18:10:16,472 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_021_56.bin
2026-04-21 18:10:16,474 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_022_27.bin
2026-04-21 18:10:16,477 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_023_13.bin
2026-04-21 18:10:16,479 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_024_27.bin
2026-04-21 18:10:16,482 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_025_08.bin
2026-04-21 18:10:16,484 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_026_28.bin
2026-04-21 18:10:16,487 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_026_30.bin
2026-04-21 18:10:16,489 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_027_00.bin
2026-04-21 18:10:16,492 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_027_36.bin
2026-04-21 18:10:16,494 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_028_17.bin
2026-04-21 18:10:16,497 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_028_31.bin
2026-04-21 18:10:16,499 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_029_51.bin
2026-04-21 18:10:16,502 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_031_39.bin
2026-04-21 18:10:16,504 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_032_38.bin
2026-04-21 18:10:16,507 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_033_08.bin
2026-04-21 18:10:16,509 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_034_16.bin
2026-04-21 18:10:16,511 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_034_30.bin
2026-04-21 18:10:16,513 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_035_35.bin
2026-04-21 18:10:16,515 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_035_49.bin
2026-04-21 18:10:16,517 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_036_43.bin
2026-04-21 18:10:16,520 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_037_03.bin
2026-04-21 18:10:16,522 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_037_28.bin
2026-04-21 18:10:16,525 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_038_08.bin
2026-04-21 18:10:16,526 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_039_30.bin
2026-04-21 18:10:16,528 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_041_49.bin
2026-04-21 18:10:16,530 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_042_14.bin
2026-04-21 18:10:16,531 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_042_51.bin
2026-04-21 18:10:16,533 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_043_34.bin
2026-04-21 18:10:16,535 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_044_00.bin
2026-04-21 18:10:16,536 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_045_05.bin
2026-04-21 18:10:16,538 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_046_47.bin
2026-04-21 18:10:16,539 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_047_16.bin
2026-04-21 18:10:16,541 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_047_50.bin
2026-04-21 18:10:16,542 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_048_59.bin
2026-04-21 18:10:16,544 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_049_39.bin
2026-04-21 18:10:16,546 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_101_33.bin
2026-04-21 18:10:16,547 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_102_22.bin
2026-04-21 18:10:16,549 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_102_31.bin
2026-04-21 18:10:16,550 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_103_44.bin
2026-04-21 18:10:16,552 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_104_33.bin
2026-04-21 18:10:16,553 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_104_38.bin
2026-04-21 18:10:16,555 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_105_50.bin
2026-04-21 18:10:16,556 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_105_58.bin
2026-04-21 18:10:16,558 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_106_19.bin
2026-04-21 18:10:16,559 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_107_25.bin
2026-04-21 18:10:16,561 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_107_30.bin
2026-04-21 18:10:16,562 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_108_44.bin
2026-04-21 18:10:16,564 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_109_23.bin
2026-04-21 18:10:16,566 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_111_36.bin
2026-04-21 18:10:16,567 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_112_08.bin
2026-04-21 18:10:16,569 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_113_13.bin
2026-04-21 18:10:16,570 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_113_56.bin
2026-04-21 18:10:16,572 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_114_00.bin
2026-04-21 18:10:16,574 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_115_59.bin
2026-04-21 18:10:16,575 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_116_09.bin
2026-04-21 18:10:16,577 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_117_41.bin
2026-04-21 18:10:16,578 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_117_56.bin
2026-04-21 18:10:16,580 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_118_11.bin
2026-04-21 18:10:16,581 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_118_15.bin
2026-04-21 18:10:16,583 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_119_12.bin
2026-04-21 18:10:16,584 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_119_24.bin
2026-04-21 18:10:16,586 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_121_01.bin
2026-04-21 18:10:16,587 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_122_00.bin
2026-04-21 18:10:16,589 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_123_58.bin
2026-04-21 18:10:16,590 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_124_10.bin
2026-04-21 18:10:16,592 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_125_08.bin
2026-04-21 18:10:16,593 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_125_39.bin
2026-04-21 18:10:16,595 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_126_16.bin
2026-04-21 18:10:16,596 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_126_55.bin
2026-04-21 18:10:16,598 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_127_27.bin
2026-04-21 18:10:16,599 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_127_32.bin
2026-04-21 18:10:16,601 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_128_37.bin
2026-04-21 18:10:16,602 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_129_41.bin
2026-04-21 18:10:16,604 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_129_56.bin
2026-04-21 18:10:16,605 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_131_19.bin
2026-04-21 18:10:16,607 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_132_42.bin
2026-04-21 18:10:16,608 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_133_46.bin
2026-04-21 18:10:16,610 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_134_00.bin
2026-04-21 18:10:16,611 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_135_57.bin
2026-04-21 18:10:16,613 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_136_39.bin
2026-04-21 18:10:16,614 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_137_20.bin
2026-04-21 18:10:16,616 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_137_48.bin
2026-04-21 18:10:16,617 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_138_22.bin
2026-04-21 18:10:16,619 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_138_46.bin
2026-04-21 18:10:16,620 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_139_29.bin
2026-04-21 18:10:16,622 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_141_27.bin
2026-04-21 18:10:16,624 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_142_19.bin
2026-04-21 18:10:16,625 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_142_58.bin
2026-04-21 18:10:16,627 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_143_02.bin
2026-04-21 18:10:16,628 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_144_31.bin
2026-04-21 18:10:16,630 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_145_01.bin
2026-04-21 18:10:16,631 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_146_11.bin
2026-04-21 18:10:16,633 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_147_16.bin
2026-04-21 18:10:16,634 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_148_25.bin
2026-04-21 18:10:16,636 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_149_15.bin
2026-04-21 18:10:16,637 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_149_54.bin
2026-04-21 18:10:16,639 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_211_56.bin
2026-04-21 18:10:16,641 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_212_44.bin
2026-04-21 18:10:16,642 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_213_37.bin
2026-04-21 18:10:16,643 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_214_19.bin
2026-04-21 18:10:16,645 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_215_15.bin
2026-04-21 18:10:16,647 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_216_09.bin
2026-04-21 18:10:16,648 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_216_20.bin
2026-04-21 18:10:16,650 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_217_27.bin
2026-04-21 18:10:16,651 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_218_42.bin
2026-04-21 18:10:16,653 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_218_47.bin
2026-04-21 18:10:16,654 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_219_15.bin
2026-04-21 18:10:16,656 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_219_22.bin
2026-04-21 18:10:16,658 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_221_16.bin
2026-04-21 18:10:16,659 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_221_32.bin
2026-04-21 18:10:16,661 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_222_12.bin
2026-04-21 18:10:16,662 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_223_29.bin
2026-04-21 18:10:16,664 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_224_28.bin
2026-04-21 18:10:16,665 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_225_08.bin
2026-04-21 18:10:16,667 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_226_07.bin
2026-04-21 18:10:16,668 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_227_19.bin
2026-04-21 18:10:16,670 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_227_48.bin
2026-04-21 18:10:16,672 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_228_46.bin
2026-04-21 18:10:16,673 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_228_49.bin
2026-04-21 18:10:16,675 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_229_55.bin
2026-04-21 18:10:16,676 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_231_28.bin
2026-04-21 18:10:16,678 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_232_20.bin
2026-04-21 18:10:16,680 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_233_17.bin
2026-04-21 18:10:16,681 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_234_48.bin
2026-04-21 18:10:16,683 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_235_39.bin
2026-04-21 18:10:16,684 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_236_43.bin
2026-04-21 18:10:16,686 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_237_53.bin
2026-04-21 18:10:16,688 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_238_17.bin
2026-04-21 18:10:16,689 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_239_30.bin
2026-04-21 18:10:16,691 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_241_39.bin
2026-04-21 18:10:16,692 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_242_57.bin
2026-04-21 18:10:16,694 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_243_31.bin
2026-04-21 18:10:16,696 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_244_14.bin
2026-04-21 18:10:16,697 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_245_14.bin
2026-04-21 18:10:16,699 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_246_10.bin
2026-04-21 18:10:16,700 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_247_06.bin
2026-04-21 18:10:16,702 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_247_32.bin
2026-04-21 18:10:16,703 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_248_25.bin
2026-04-21 18:10:16,705 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_248_48.bin
2026-04-21 18:10:16,706 file: loader.py func: loader line No: 287 Read raw file: /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32/scene_249_57.bin
2026-04-21 18:10:16,708 file: tool_utils.py func: tool_utils line No: 368 num of calibration data: 160
2026-04-21 18:10:16,708 file: tool_utils.py func: tool_utils line No: 369 calibration data shape: (1, 5, 360, 640)
2026-04-21 18:10:16,803 file: hb_mapper_makertbin.py func: hb_mapper_makertbin line No: 519 call build params:
 
2026-04-21 18:10:16,833 file: model_debugger.py func: model_debugger line No: 67 Loading horizon_nn debug methods:set()
2026-04-21 18:10:16,833 file: quantization_config.py func: quantization_config line No: 305 The activation calibration parameters:
    calibration_type:     max
    max_percentile:       0.9999
    per_channel:          True
The input of node Conv_170 are set to : int16
The output of node Conv_170 are set to : int16
The input of node Conv_171 are set to : int16
The output of node Conv_171 are set to : int16
There are 10 nodes designated to run on the cpu: ['Conv_16', 'Conv_14', 'Conv_12', 'Conv_9', 'Resize_220', 'Resize_229', 'Where_263_add', 'Where_340_add', 'ScatterND_337', 'ScatterND_414'].
There are 2 nodes designated to run on the bpu: ['Conv_170', 'Conv_171'].
2026-04-21 18:10:16,834 file: model_builder.py func: model_builder line No: 197 The specified model compilation architecture: bayes-e.
2026-04-21 18:10:16,834 file: model_builder.py func: model_builder line No: 207 The specified model compilation optimization parameters: [].
2026-04-21 18:10:16,834 file: model_builder.py func: model_builder line No: 35 Start to prepare the onnx model.
2026-04-21 18:10:16,895 file: prepare.py func: prepare line No: 106 Input ONNX Model Information:
ONNX IR version:          7
Opset version:            ['ai.onnx v11', 'horizon v1']
Producer:                 pytorch v1.10
Domain:                   None
Version:                  None
Graph input:
    input:                shape=[1, 5, 360, 640], dtype=FLOAT32
Graph output:
    ...entation:          shape=['ScatterNDsegmentation_dim_0', 'ScatterNDsegmentation_dim_1', 'ScatterNDsegmentation_dim_2', 'ScatterNDsegmentation_dim_3'], dtype=FLOAT32
    depth:                shape=['Sigmoiddepth_dim_0', 1, 'Sigmoiddepth_dim_2', 'Sigmoiddepth_dim_3'], dtype=FLOAT32
2026-04-21 18:10:17,011 file: model_builder.py func: model_builder line No: 38 End to prepare the onnx model.
2026-04-21 18:10:17,060 file: model_builder.py func: model_builder line No: 265 Saving model to: lraspp_99_torch110_3_original_float_model.onnx.
2026-04-21 18:10:17,060 file: model_builder.py func: model_builder line No: 35 Start to optimize the onnx model.
2026-04-21 18:10:18,887 file: constant_folding.py func: constant_folding line No: 66 Summary info for constant_folding:
2026-04-21 18:10:18,887 file: constant_folding.py func: constant_folding line No: 67   After constant_folding, the number of nodes has changed from 415 to 207.
2026-04-21 18:10:18,887 file: constant_folding.py func: constant_folding line No: 71   After constant_folding, the number of parameters has changed from 3407002 to 22299713.
2026-04-21 18:10:18,887 file: constant_folding.py func: constant_folding line No: 76 Detailed info for constant_folding:
2026-04-21 18:10:18,887 file: constant_folding.py func: constant_folding line No: 88   After folding node (op_name: ConstantOfShape_244, op_type: ConstantOfShape), the number of increased parameters is 3455995.
  After folding node (op_name: Expand_380, op_type: Expand), the number of increased parameters is 2995195.
  After folding node (op_name: Expand_388, op_type: Expand), the number of increased parameters is 2995183.
  After folding node (op_name: Expand_396, op_type: Expand), the number of increased parameters is 2994836.
  After folding node (op_name: Expand_404, op_type: Expand), the number of increased parameters is 2994556.
  After folding node (op_name: Add_372, op_type: Add), the number of increased parameters is 2990520.
  After folding node (op_name: Gather_262, op_type: Gather), the number of increased parameters is 691197.
  After folding node (op_name: Expand_303, op_type: Expand), the number of increased parameters is 691195.
  After folding node (op_name: Expand_311, op_type: Expand), the number of increased parameters is 691193.
  After folding node (op_name: Expand_319, op_type: Expand), the number of increased parameters is 690836.
  After folding node (op_name: Expand_327, op_type: Expand), the number of increased parameters is 690556.
  After folding node (op_name: Add_295, op_type: Add), the number of increased parameters is 690120.
  After folding node (op_name: Add_371, op_type: Add), the number of increased parameters is 4667.
  After folding node (op_name: Add_294, op_type: Add), the number of increased parameters is 1077.
  After folding node (op_name: Range_286, op_type: Range), the number of increased parameters is 637.
  After folding node (op_name: Range_363, op_type: Range), the number of increased parameters is 637.
  After folding node (op_name: Range_279, op_type: Range), the number of increased parameters is 357.
  After folding node (op_name: Range_356, op_type: Range), the number of increased parameters is 357.
  After folding node (op_name: Mul_300, op_type: Mul), the number of increased parameters is 3.
  After folding node (op_name: Mul_308, op_type: Mul), the number of increased parameters is 3.
  After folding node (op_name: Mul_316, op_type: Mul), the number of increased parameters is 3.
  After folding node (op_name: Mul_324, op_type: Mul), the number of increased parameters is 3.
  After folding node (op_name: Mul_377, op_type: Mul), the number of increased parameters is 3.
  After folding node (op_name: Mul_385, op_type: Mul), the number of increased parameters is 3.
  After folding node (op_name: Mul_393, op_type: Mul), the number of increased parameters is 3.
  After folding node (op_name: Mul_401, op_type: Mul), the number of increased parameters is 3.
  After folding node (op_name: ConstantOfShape_298, op_type: ConstantOfShape), the number of increased parameters is 2.
  After folding node (op_name: ConstantOfShape_306, op_type: ConstantOfShape), the number of increased parameters is 2.
  After folding node (op_name: ConstantOfShape_314, op_type: ConstantOfShape), the number of increased parameters is 2.
  After folding node (op_name: ConstantOfShape_322, op_type: ConstantOfShape), the number of increased parameters is 2.
  After folding node (op_name: ConstantOfShape_375, op_type: ConstantOfShape), the number of increased parameters is 2.
  After folding node (op_name: ConstantOfShape_383, op_type: ConstantOfShape), the number of increased parameters is 2.
  After folding node (op_name: ConstantOfShape_391, op_type: ConstantOfShape), the number of increased parameters is 2.
  After folding node (op_name: ConstantOfShape_399, op_type: ConstantOfShape), the number of increased parameters is 2.
  After folding node (op_name: Concat_166, op_type: Concat), the number of increased parameters is 0.
  After folding node (op_name: Concat_188, op_type: Concat), the number of increased parameters is 0.
  After folding node (op_name: Concat_201, op_type: Concat), the number of increased parameters is 0.
  After folding node (op_name: Concat_217, op_type: Concat), the number of increased parameters is 0.
  After folding node (op_name: Concat_226, op_type: Concat), the number of increased parameters is 0.
  After folding node (op_name: Unsqueeze_240, op_type: Unsqueeze), the number of increased parameters is 0.
  After folding node (op_name: Unsqueeze_241, op_type: Unsqueeze), the number of increased parameters is 0.
  After folding node (op_name: Unsqueeze_242, op_type: Unsqueeze), the number of increased parameters is 0.
  After folding node (op_name: Concat_243, op_type: Concat), the number of increased parameters is 0.
  After folding node (op_name: Cast_269, op_type: Cast), the number of increased parameters is 0.
  After folding node (op_name: Cast_276, op_type: Cast), the number of increased parameters is 0.
  After folding node (op_name: Cast_283, op_type: Cast), the number of increased parameters is 0.
  After folding node (op_name: Add_293, op_type: Add), the number of increased parameters is 0.
  After folding node (op_name: Cast_346, op_type: Cast), the number of increased parameters is 0.
  After folding node (op_name: Cast_353, op_type: Cast), the number of increased parameters is 0.
  After folding node (op_name: Cast_360, op_type: Cast), the number of increased parameters is 0.
  After folding node (op_name: Add_370, op_type: Add), the number of increased parameters is 0.
  After folding node (op_name: Equal_301, op_type: Equal), the number of increased parameters is 0.
  After folding node (op_name: Unsqueeze_304, op_type: Unsqueeze), the number of increased parameters is 0.
  After folding node (op_name: Equal_309, op_type: Equal), the number of increased parameters is 0.
  After folding node (op_name: Unsqueeze_312, op_type: Unsqueeze), the number of increased parameters is 0.
  After folding node (op_name: Equal_317, op_type: Equal), the number of increased parameters is 0.
  After folding node (op_name: Unsqueeze_320, op_type: Unsqueeze), the number of increased parameters is 0.
  After folding node (op_name: Equal_325, op_type: Equal), the number of increased parameters is 0.
  After folding node (op_name: Unsqueeze_328, op_type: Unsqueeze), the number of increased parameters is 0.
  After folding node (op_name: Concat_329, op_type: Concat), the number of increased parameters is 0.
  After folding node (op_name: Concat_335, op_type: Concat), the number of increased parameters is 0.
  After folding node (op_name: Equal_378, op_type: Equal), the number of increased parameters is 0.
  After folding node (op_name: Unsqueeze_381, op_type: Unsqueeze), the number of increased parameters is 0.
  After folding node (op_name: Equal_386, op_type: Equal), the number of increased parameters is 0.
  After folding node (op_name: Unsqueeze_389, op_type: Unsqueeze), the number of increased parameters is 0.
  After folding node (op_name: Equal_394, op_type: Equal), the number of increased parameters is 0.
  After folding node (op_name: Unsqueeze_397, op_type: Unsqueeze), the number of increased parameters is 0.
  After folding node (op_name: Equal_402, op_type: Equal), the number of increased parameters is 0.
  After folding node (op_name: Unsqueeze_405, op_type: Unsqueeze), the number of increased parameters is 0.
  After folding node (op_name: Concat_406, op_type: Concat), the number of increased parameters is 0.
  After folding node (op_name: Concat_412, op_type: Concat), the number of increased parameters is 0.
  After folding node (op_name: Range_272, op_type: Range), the number of increased parameters is -2.
  After folding node (op_name: Reshape_291, op_type: Reshape), the number of increased parameters is -2.
  After folding node (op_name: Range_349, op_type: Range), the number of increased parameters is -2.
  After folding node (op_name: Reshape_368, op_type: Reshape), the number of increased parameters is -2.
  After folding node (op_name: Gather_233, op_type: Gather), the number of increased parameters is -4.
  After folding node (op_name: Gather_236, op_type: Gather), the number of increased parameters is -4.
  After folding node (op_name: Gather_239, op_type: Gather), the number of increased parameters is -4.
  After folding node (op_name: Gather_268, op_type: Gather), the number of increased parameters is -4.
  After folding node (op_name: Gather_275, op_type: Gather), the number of increased parameters is -4.
  After folding node (op_name: Gather_282, op_type: Gather), the number of increased parameters is -4.
  After folding node (op_name: Reshape_288, op_type: Reshape), the number of increased parameters is -4.
  After folding node (op_name: Gather_345, op_type: Gather), the number of increased parameters is -4.
  After folding node (op_name: Gather_352, op_type: Gather), the number of increased parameters is -4.
  After folding node (op_name: Gather_359, op_type: Gather), the number of increased parameters is -4.
  After folding node (op_name: Reshape_365, op_type: Reshape), the number of increased parameters is -4.
  After folding node (op_name: Where_302, op_type: Where), the number of increased parameters is -4.
  After folding node (op_name: Where_310, op_type: Where), the number of increased parameters is -4.
  After folding node (op_name: Where_318, op_type: Where), the number of increased parameters is -4.
  After folding node (op_name: Where_326, op_type: Where), the number of increased parameters is -4.
  After folding node (op_name: Where_379, op_type: Where), the number of increased parameters is -4.
  After folding node (op_name: Where_387, op_type: Where), the number of increased parameters is -4.
  After folding node (op_name: Where_395, op_type: Where), the number of increased parameters is -4.
  After folding node (op_name: Where_403, op_type: Where), the number of increased parameters is -4.
  After folding node (op_name: Slice_165, op_type: Slice), the number of increased parameters is -5.
  After folding node (op_name: Slice_187, op_type: Slice), the number of increased parameters is -5.
  After folding node (op_name: Slice_200, op_type: Slice), the number of increased parameters is -5.
  After folding node (op_name: Slice_216, op_type: Slice), the number of increased parameters is -5.
  After folding node (op_name: Slice_225, op_type: Slice), the number of increased parameters is -5.
  After folding node (op_name: Slice_334, op_type: Slice), the number of increased parameters is -7.
  After folding node (op_name: Slice_411, op_type: Slice), the number of increased parameters is -7.
2026-04-21 18:10:19,448 file: model_builder.py func: model_builder line No: 38 End to optimize the onnx model.
2026-04-21 18:10:19,598 file: model_builder.py func: model_builder line No: 265 Saving model to: lraspp_99_torch110_3_optimized_float_model.onnx.
2026-04-21 18:10:19,599 file: model_builder.py func: model_builder line No: 35 Start to calibrate the model.
2026-04-21 18:10:20,030 file: calibration_data_set.py func: calibration_data_set line No: 111 input name: input,  number_of_samples: 160
2026-04-21 18:10:20,031 file: calibration_data_set.py func: calibration_data_set line No: 123 There are 160 samples in the data set.
2026-04-21 18:10:20,031 file: infer_thresholds.py func: infer_thresholds line No: 84 Run calibration model with max-percentile:percentile=0.9999,per_channel method.
2026-04-21 18:10:20,426 file: base.py func: base line No: 138 Calibration using batch 8
2026-04-21 18:10:20,696 file: tool_utils.py func: tool_utils line No: 321 The output of Node(name:Resize_169, type:Resize) does not support data type: int16
2026-04-21 18:10:20,697 file: tool_utils.py func: tool_utils line No: 321 The output of Node(name:Resize_220, type:Resize) does not support data type: int16
2026-04-21 18:10:20,697 file: tool_utils.py func: tool_utils line No: 321 The output of Node(name:Resize_169) is int8, then requantized to int16
2026-04-21 18:10:20,697 file: tool_utils.py func: tool_utils line No: 321 The output of Node(name:Resize_220) is int8, then requantized to int16
2026-04-21 18:10:22,776 file: ort.py func: ort line No: 207 Reset batch_size=1 and execute forward again...
2026-04-21 18:11:36,525 file: base.py func: base line No: 138 Calibration using batch 8
2026-04-21 18:11:44,673 file: ort.py func: ort line No: 207 Reset batch_size=1 and execute forward again...
2026-04-21 18:15:10,191 file: modelwise_search.py func: modelwise_search line No: 62 Perchannel quantization is enabled.
2026-04-21 18:15:11,773 file: refine_threshold.py func: refine_threshold line No: 39 find illegal threshold in Add_258708_expand_dims_HzCalibration, it will be set default.
2026-04-21 18:15:12,061 file: model_builder.py func: model_builder line No: 38 End to calibrate the model.
2026-04-21 18:15:12,344 file: model_builder.py func: model_builder line No: 265 Saving model to: lraspp_99_torch110_3_calibrated_model.onnx.
2026-04-21 18:15:12,344 file: model_builder.py func: model_builder line No: 35 Start to quantize the model.
2026-04-21 18:15:15,627 file: constant_folding.py func: constant_folding line No: 66 Summary info for constant_folding:
2026-04-21 18:15:15,627 file: constant_folding.py func: constant_folding line No: 67   After constant_folding, the number of nodes has changed from 203 to 202.
2026-04-21 18:15:15,627 file: constant_folding.py func: constant_folding line No: 71   After constant_folding, the number of parameters has changed from 22325028 to 22325028.
2026-04-21 18:15:15,627 file: constant_folding.py func: constant_folding line No: 76 Detailed info for constant_folding:
2026-04-21 18:15:15,627 file: constant_folding.py func: constant_folding line No: 88   After folding node (op_name: Where_263_mul_x_NCHW2NHWC_LayoutConvert_Input1, op_type: Transpose), the number of increased parameters is 0.
2026-04-21 18:15:15,942 file: model_builder.py func: model_builder line No: 38 End to quantize the model.
2026-04-21 18:15:16,196 file: model_builder.py func: model_builder line No: 265 Saving model to: lraspp_99_torch110_3_quantized_model.onnx.
2026-04-21 18:15:16,197 file: model_builder.py func: model_builder line No: 35 Start to compile the model with march bayes-e.
2026-04-21 18:15:17,665 file: hybrid_build.py func: hybrid_build line No: 111 Compile submodel: torch-jit-export_subgraph_0
2026-04-21 18:15:17,768 file: hbdk_cc.py func: hbdk_cc line No: 126 hbdk-cc parameters:['--O3', '--core-num', '1', '--fast', '--input-layout', 'NHWC', '--output-layout', 'NHWC', '--input-source', 'ddr']
2026-04-21 18:15:17,768 file: hbdk_cc.py func: hbdk_cc line No: 127 hbdk-cc command used:hbdk-cc -f hbir -m /tmp/tmp46j06mzs/torch-jit-export_subgraph_0.hbir -o /tmp/tmp46j06mzs/torch-jit-export_subgraph_0.hbm --march bayes-e --progressbar --O3 --core-num 1 --fast --input-layout NHWC --output-layout NHWC --input-source ddr
2026-04-21 18:15:24,468 file: tool_utils.py func: tool_utils line No: 326 consumed time 6.67465
2026-04-21 18:15:24,502 file: tool_utils.py func: tool_utils line No: 326 FPS=437.1, latency = 2287.8 us, DDR = 15902272 bytes   (see torch-jit-export_subgraph_0.html)
2026-04-21 18:15:24,504 file: hybrid_build.py func: hybrid_build line No: 111 Compile submodel: torch-jit-export_subgraph_1
2026-04-21 18:15:24,598 file: hbdk_cc.py func: hbdk_cc line No: 126 hbdk-cc parameters:['--O3', '--core-num', '1', '--fast', '--input-layout', 'NHWC', '--output-layout', 'NHWC', '--input-source', 'ddr']
2026-04-21 18:15:24,598 file: hbdk_cc.py func: hbdk_cc line No: 127 hbdk-cc command used:hbdk-cc -f hbir -m /tmp/tmp46j06mzs/torch-jit-export_subgraph_1.hbir -o /tmp/tmp46j06mzs/torch-jit-export_subgraph_1.hbm --march bayes-e --progressbar --O3 --core-num 1 --fast --input-layout NHWC --output-layout NHWC --input-source ddr
2026-04-21 18:15:32,950 file: tool_utils.py func: tool_utils line No: 326 consumed time 8.33303
2026-04-21 18:15:32,991 file: tool_utils.py func: tool_utils line No: 326 FPS=842.12, latency = 1187.5 us, DDR = 7627136 bytes   (see torch-jit-export_subgraph_1.html)
2026-04-21 18:15:32,993 file: hybrid_build.py func: hybrid_build line No: 111 Compile submodel: torch-jit-export_subgraph_2
2026-04-21 18:15:33,100 file: hbdk_cc.py func: hbdk_cc line No: 126 hbdk-cc parameters:['--O3', '--core-num', '1', '--fast', '--input-layout', 'NHWC', '--output-layout', 'NHWC', '--input-source', 'ddr,ddr,ddr,ddr,ddr']
2026-04-21 18:15:33,101 file: hbdk_cc.py func: hbdk_cc line No: 127 hbdk-cc command used:hbdk-cc -f hbir -m /tmp/tmp46j06mzs/torch-jit-export_subgraph_2.hbir -o /tmp/tmp46j06mzs/torch-jit-export_subgraph_2.hbm --march bayes-e --progressbar --O3 --core-num 1 --fast --input-layout NHWC --output-layout NHWC --input-source ddr,ddr,ddr,ddr,ddr
2026-04-21 18:18:55,465 file: tool_utils.py func: tool_utils line No: 326 consumed time 202.346
2026-04-21 18:18:55,590 file: tool_utils.py func: tool_utils line No: 326 FPS=51.81, latency = 19299.7 us, DDR = 101666272 bytes   (see torch-jit-export_subgraph_2.html)
2026-04-21 18:18:55,606 file: hybrid_build.py func: hybrid_build line No: 111 Compile submodel: torch-jit-export_subgraph_3
2026-04-21 18:18:55,696 file: hbdk_cc.py func: hbdk_cc line No: 126 hbdk-cc parameters:['--O3', '--core-num', '1', '--fast', '--input-layout', 'NHWC', '--output-layout', 'NHWC', '--input-source', 'ddr,ddr']
2026-04-21 18:18:55,696 file: hbdk_cc.py func: hbdk_cc line No: 127 hbdk-cc command used:hbdk-cc -f hbir -m /tmp/tmp46j06mzs/torch-jit-export_subgraph_3.hbir -o /tmp/tmp46j06mzs/torch-jit-export_subgraph_3.hbm --march bayes-e --progressbar --O3 --core-num 1 --fast --input-layout NHWC --output-layout NHWC --input-source ddr,ddr
2026-04-21 18:20:53,335 file: tool_utils.py func: tool_utils line No: 326 consumed time 117.621
2026-04-21 18:20:53,391 file: tool_utils.py func: tool_utils line No: 326 FPS=195.46, latency = 5116.3 us, DDR = 12011520 bytes   (see torch-jit-export_subgraph_3.html)
2026-04-21 18:20:53,397 file: hybrid_build.py func: hybrid_build line No: 111 Compile submodel: torch-jit-export_subgraph_4
2026-04-21 18:20:53,500 file: hbdk_cc.py func: hbdk_cc line No: 126 hbdk-cc parameters:['--O3', '--core-num', '1', '--fast', '--input-layout', 'NHWC', '--output-layout', 'NHWC', '--input-source', 'ddr']
2026-04-21 18:20:53,500 file: hbdk_cc.py func: hbdk_cc line No: 127 hbdk-cc command used:hbdk-cc -f hbir -m /tmp/tmp46j06mzs/torch-jit-export_subgraph_4.hbir -o /tmp/tmp46j06mzs/torch-jit-export_subgraph_4.hbm --march bayes-e --progressbar --O3 --core-num 1 --fast --input-layout NHWC --output-layout NHWC --input-source ddr
2026-04-21 18:21:24,717 file: tool_utils.py func: tool_utils line No: 326 consumed time 31.1971
2026-04-21 18:21:24,767 file: tool_utils.py func: tool_utils line No: 326 FPS=2554.54, latency = 391.5 us, DDR = 3456384 bytes   (see torch-jit-export_subgraph_4.html)
2026-04-21 18:21:24,769 file: hybrid_build.py func: hybrid_build line No: 111 Compile submodel: torch-jit-export_subgraph_5
2026-04-21 18:21:24,862 file: hbdk_cc.py func: hbdk_cc line No: 126 hbdk-cc parameters:['--O3', '--core-num', '1', '--fast', '--input-layout', 'NHWC', '--output-layout', 'NHWC', '--input-source', 'ddr,ddr']
2026-04-21 18:21:24,862 file: hbdk_cc.py func: hbdk_cc line No: 127 hbdk-cc command used:hbdk-cc -f hbir -m /tmp/tmp46j06mzs/torch-jit-export_subgraph_5.hbir -o /tmp/tmp46j06mzs/torch-jit-export_subgraph_5.hbm --march bayes-e --progressbar --O3 --core-num 1 --fast --input-layout NHWC --output-layout NHWC --input-source ddr,ddr
2026-04-21 18:22:06,317 file: tool_utils.py func: tool_utils line No: 326 consumed time 41.4365
2026-04-21 18:22:06,353 file: tool_utils.py func: tool_utils line No: 326 FPS=385.25, latency = 2595.7 us, DDR = 5299584 bytes   (see torch-jit-export_subgraph_5.html)
2026-04-21 18:22:06,355 file: hybrid_build.py func: hybrid_build line No: 111 Compile submodel: torch-jit-export_subgraph_6
2026-04-21 18:22:06,436 file: hbdk_cc.py func: hbdk_cc line No: 126 hbdk-cc parameters:['--O3', '--core-num', '1', '--fast', '--input-layout', 'NHWC', '--output-layout', 'NHWC', '--input-source', 'ddr,ddr']
2026-04-21 18:22:06,436 file: hbdk_cc.py func: hbdk_cc line No: 127 hbdk-cc command used:hbdk-cc -f hbir -m /tmp/tmp46j06mzs/torch-jit-export_subgraph_6.hbir -o /tmp/tmp46j06mzs/torch-jit-export_subgraph_6.hbm --march bayes-e --progressbar --O3 --core-num 1 --fast --input-layout NHWC --output-layout NHWC --input-source ddr,ddr
2026-04-21 18:22:07,841 file: tool_utils.py func: tool_utils line No: 326 consumed time 1.38899
2026-04-21 18:22:07,873 file: tool_utils.py func: tool_utils line No: 326 FPS=282.9, latency = 3534.8 us, DDR = 9908224 bytes   (see torch-jit-export_subgraph_6.html)
2026-04-21 18:22:07,875 file: hybrid_build.py func: hybrid_build line No: 111 Compile submodel: torch-jit-export_subgraph_7
2026-04-21 18:22:07,955 file: hbdk_cc.py func: hbdk_cc line No: 126 hbdk-cc parameters:['--O3', '--core-num', '1', '--fast', '--input-layout', 'NHWC', '--output-layout', 'NHWC', '--input-source', 'ddr,ddr']
2026-04-21 18:22:07,955 file: hbdk_cc.py func: hbdk_cc line No: 127 hbdk-cc command used:hbdk-cc -f hbir -m /tmp/tmp46j06mzs/torch-jit-export_subgraph_7.hbir -o /tmp/tmp46j06mzs/torch-jit-export_subgraph_7.hbm --march bayes-e --progressbar --O3 --core-num 1 --fast --input-layout NHWC --output-layout NHWC --input-source ddr,ddr
2026-04-21 18:22:08,837 file: tool_utils.py func: tool_utils line No: 326 consumed time 0.864821
2026-04-21 18:22:08,870 file: tool_utils.py func: tool_utils line No: 326 FPS=101.67, latency = 9836.0 us, DDR = 72346624 bytes   (see torch-jit-export_subgraph_7.html)
2026-04-21 18:22:09,328 file: model_builder.py func: model_builder line No: 38 End to compile the model with march bayes-e.
2026-04-21 18:22:17,710 file: print_info_dict.py func: print_info_dict line No: 72 The main quantized node information:
===================================================================================================================
Node                         ON   Subgraph  Type                           Cosine Similarity  Threshold  DataType  
-------------------------------------------------------------------------------------------------------------------
Conv_0                       BPU  id(0)     HzSQuantizedConv               0.998309           2.60514    int8      
Mul_2                        BPU  id(0)     HzLut                          0.997139           10.1118    int8      
Conv_3                       BPU  id(0)     HzSQuantizedConv               0.994793           8.38896    int8      
Conv_5                       BPU  id(0)     HzSQuantizedConv               0.993418           10.6208    int8      
Conv_7                       BPU  id(0)     HzSQuantizedConv               0.993278           13.4133    int8      
Conv_9                       CPU  --        Conv                           0.989467           --         float     
Relu_10                      CPU  --        Relu                           0.990015           --         float     
Conv_11                      BPU  id(1)     HzSQuantizedConv               0.989846           7.45639    int8      
Conv_12                      CPU  --        Conv                           0.987067           7.40217    float     
Relu_13                      CPU  --        Relu                           0.988067           --         float     
Conv_14                      CPU  --        Conv                           0.977649           --         float     
Relu_15                      CPU  --        Relu                           0.979836           --         float     
Conv_16                      CPU  --        Conv                           0.972007           --         float     
Add_17                       BPU  id(2)     HzSElementwiseAdd              0.984252           6.92611    int16     
Conv_18                      BPU  id(2)     HzSQuantizedConv               0.984796           9.87873    int8      
Conv_20                      BPU  id(2)     HzSQuantizedConv               0.984828           2.64261    int8      
GlobalAveragePool_22         BPU  id(2)     HzSQuantizedGlobalAveragePool  0.998459           6.95949    int8      
Conv_23                      BPU  id(2)     HzSQuantizedConv               0.998830           1.58743    int8      
Conv_25                      BPU  id(2)     HzSQuantizedConv               0.999313           3.06873    int8      
HardSigmoid_26               BPU  id(2)     HzLut                          0.999946           3.0        int8      
Mul_27                       BPU  id(2)     HzSElementwiseMul              0.986581           6.95949    int8      
Conv_28                      BPU  id(2)     HzSQuantizedConv               0.982724           3.88759    int8      
Conv_29                      BPU  id(2)     HzSQuantizedConv               0.982754           8.91332    int8      
Conv_31                      BPU  id(2)     HzSQuantizedConv               0.979796           10.7328    int8      
GlobalAveragePool_33         BPU  id(2)     HzSQuantizedGlobalAveragePool  0.998155           6.64232    int8      
Conv_34                      BPU  id(2)     HzSQuantizedConv               0.997984           1.38505    int8      
Conv_36                      BPU  id(2)     HzSQuantizedConv               0.997765           2.83628    int8      
HardSigmoid_37               BPU  id(2)     HzLut                          0.999923           3.0        int8      
Mul_38                       BPU  id(2)     HzSElementwiseMul              0.979105           6.64232    int8      
Conv_39                      BPU  id(2)     HzSQuantizedConv               0.975420           3.49788    int8      
Conv_41                      BPU  id(2)     HzSQuantizedConv               0.979945           9.72655    int8      
Conv_43                      BPU  id(2)     HzSQuantizedConv               0.974948           5.83646    int8      
GlobalAveragePool_45         BPU  id(2)     HzSQuantizedGlobalAveragePool  0.998120           6.22035    int8      
Conv_46                      BPU  id(2)     HzSQuantizedConv               0.999102           1.35851    int8      
Conv_48                      BPU  id(2)     HzSQuantizedConv               0.998521           2.50488    int8      
HardSigmoid_49               BPU  id(2)     HzLut                          0.999941           3.0        int8      
Mul_50                       BPU  id(2)     HzSElementwiseMul              0.975025           6.22035    int8      
Conv_51                      BPU  id(2)     HzSQuantizedConv               0.968754           3.42053    int8      
Conv_53                      BPU  id(2)     HzSQuantizedConv               0.978877           11.719     int8      
Mul_55                       BPU  id(2)     HzLut                          0.977897           6.18352    int8      
Conv_56                      BPU  id(2)     HzSQuantizedConv               0.976582           5.49882    int8      
Mul_58                       BPU  id(2)     HzLut                          0.974566           6.70217    int8      
Conv_59                      BPU  id(2)     HzSQuantizedConv               0.976197           6.17035    int8      
Conv_60                      BPU  id(2)     HzSQuantizedConv               0.976695           5.96844    int8      
Mul_62                       BPU  id(2)     HzLut                          0.975596           5.96307    int8      
Conv_63                      BPU  id(2)     HzSQuantizedConv               0.976160           5.39971    int8      
Mul_65                       BPU  id(2)     HzLut                          0.975066           7.23024    int8      
Conv_66                      BPU  id(2)     HzSQuantizedConv               0.976889           6.45607    int8      
Conv_68                      BPU  id(2)     HzSQuantizedConv               0.977845           9.73712    int8      
Mul_70                       BPU  id(2)     HzLut                          0.975040           6.1501     int8      
Conv_71                      BPU  id(2)     HzSQuantizedConv               0.974420           5.51793    int8      
Mul_73                       BPU  id(2)     HzLut                          0.972013           7.61577    int8      
Conv_74                      BPU  id(2)     HzSQuantizedConv               0.970975           6.46644    int8      
Conv_76                      BPU  id(2)     HzSQuantizedConv               0.976722           12.7433    int8      
Mul_78                       BPU  id(2)     HzLut                          0.973927           6.101      int8      
Conv_79                      BPU  id(2)     HzSQuantizedConv               0.972326           5.49539    int8      
Mul_81                       BPU  id(2)     HzLut                          0.970471           7.35668    int8      
Conv_82                      BPU  id(2)     HzSQuantizedConv               0.970568           6.85795    int8      
Conv_84                      BPU  id(2)     HzSQuantizedConv               0.977885           14.7823    int8      
Mul_86                       BPU  id(2)     HzLut                          0.975841           6.50371    int8      
Conv_87                      BPU  id(2)     HzSQuantizedConv               0.980026           5.84439    int8      
Mul_89                       BPU  id(2)     HzLut                          0.978040           7.02248    int8      
GlobalAveragePool_90         BPU  id(2)     HzSQuantizedGlobalAveragePool  0.988478           6.00915    int8      
Conv_91                      BPU  id(2)     HzSQuantizedConv               0.991890           0.735733   int8      
Conv_93                      BPU  id(2)     HzSQuantizedConv               0.987870           1.31595    int8      
HardSigmoid_94               BPU  id(2)     HzLut                          0.999955           3.0        int8      
Mul_95                       BPU  id(2)     HzSElementwiseMul              0.977780           6.00915    int8      
Conv_96                      BPU  id(2)     HzSQuantizedConv               0.982391           3.01919    int8      
Conv_97                      BPU  id(2)     HzSQuantizedConv               0.980912           6.12108    int8      
Mul_99                       BPU  id(2)     HzLut                          0.978120           6.09146    int8      
Conv_100                     BPU  id(2)     HzSQuantizedConv               0.979066           5.3224     int8      
Mul_102                      BPU  id(2)     HzLut                          0.976178           6.42492    int8      
GlobalAveragePool_103        BPU  id(2)     HzSQuantizedGlobalAveragePool  0.986539           5.50206    int8      
Conv_104                     BPU  id(2)     HzSQuantizedConv               0.988414           0.716637   int8      
Conv_106                     BPU  id(2)     HzSQuantizedConv               0.989756           1.25979    int8      
HardSigmoid_107              BPU  id(2)     HzLut                          0.999962           3.0        int8      
Mul_108                      BPU  id(2)     HzSElementwiseMul              0.975766           5.50206    int8      
Conv_109                     BPU  id(2)     HzSQuantizedConv               0.978079           2.75737    int8      
Conv_111                     BPU  id(2)     HzSQuantizedConv               0.983244           9.25892    int8      
Mul_113                      BPU  id(2)     HzLut                          0.981259           5.96636    int8      
Conv_114                     BPU  id(2)     HzSQuantizedConv               0.984386           5.35833    int8      
Mul_116                      BPU  id(2)     HzLut                          0.983292           5.25003    int8      
GlobalAveragePool_117        BPU  id(2)     HzSQuantizedGlobalAveragePool  0.990978           4.55044    int8      
Conv_118                     BPU  id(2)     HzSQuantizedConv               0.990572           0.679636   int8      
Conv_120                     BPU  id(2)     HzSQuantizedConv               0.990192           1.42778    int8      
HardSigmoid_121              BPU  id(2)     HzLut                          0.999943           3.0        int8      
Mul_122                      BPU  id(2)     HzSElementwiseMul              0.983210           4.55044    int8      
Conv_123                     BPU  id(2)     HzSQuantizedConv               0.986663           2.30824    int8      
Conv_124                     BPU  id(2)     HzSQuantizedConv               0.984773           3.97706    int8      
Mul_126                      BPU  id(2)     HzLut                          0.982123           4.26568    int8      
Conv_127                     BPU  id(2)     HzSQuantizedConv               0.983495           3.91516    int8      
Mul_129                      BPU  id(2)     HzLut                          0.981454           4.61371    int8      
GlobalAveragePool_130        BPU  id(2)     HzSQuantizedGlobalAveragePool  0.987419           4.02593    int8      
Conv_131                     BPU  id(2)     HzSQuantizedConv               0.986096           0.831746   int8      
Conv_133                     BPU  id(2)     HzSQuantizedConv               0.987276           1.60407    int8      
HardSigmoid_134              BPU  id(2)     HzLut                          0.999947           3.0        int8      
Mul_135                      BPU  id(2)     HzSElementwiseMul              0.981251           4.02593    int8      
Conv_136                     BPU  id(2)     HzSQuantizedConv               0.978535           2.02635    int8      
Conv_138                     BPU  id(2)     HzSQuantizedConv               0.980793           5.57953    int8      
Mul_140                      BPU  id(2)     HzLut                          0.978546           4.08763    int8      
Conv_141                     BPU  id(2)     HzSQuantizedConv               0.979085           3.83882    int8      
Mul_143                      BPU  id(2)     HzLut                          0.976899           4.69576    int8      
GlobalAveragePool_144        BPU  id(2)     HzSQuantizedGlobalAveragePool  0.982624           4.15493    int8      
Conv_145                     BPU  id(2)     HzSQuantizedConv               0.983943           0.940707   int8      
Conv_147                     BPU  id(2)     HzSQuantizedConv               0.980318           1.45592    int8      
HardSigmoid_148              BPU  id(2)     HzLut                          0.999922           3.0        int8      
Mul_149                      BPU  id(2)     HzSElementwiseMul              0.976605           4.15493    int8      
Conv_150                     BPU  id(2)     HzSQuantizedConv               0.968489           2.1268     int8      
Conv_152                     BPU  id(2)     HzSQuantizedConv               0.977789           7.32364    int8      
Mul_154                      BPU  id(2)     HzLut                          0.975462           4.23463    int8      
Conv_155                     BPU  id(2)     HzSQuantizedConv               0.978271           3.96237    int8      
GlobalAveragePool_157        BPU  id(2)     HzSQuantizedGlobalAveragePool  0.989122           3.96237    int8      
Conv_158                     BPU  id(2)     HzSQuantizedConv               0.999773           1.09325    int8      
Sigmoid_159                  BPU  id(2)     HzLut                          0.999979           5.49897    int8      
Mul_160                      BPU  id(2)     HzSElementwiseMul              0.983042           6.08904    int8      
583_calibrated_Requantize    BPU  id(2)     HzRequantize                   --                 --         int16     
Resize_169                   BPU  id(2)     HzQuantizedRoiResize           0.987127           4.27314    int8      
Conv_170                     BPU  id(1)     HzSQuantizedConv               0.988124           7.40217    int16     
598_Requantize               BPU  id(2)     HzRequantize                   --                 --         int8      
Conv_171                     BPU  id(2)     HzSQuantizedConv               0.994511           4.27314    int16     
Add_172                      BPU  id(2)     HzSElementwiseAdd              0.994181           8.2247     int16     
Conv_173                     BPU  id(1)     HzSQuantizedConv               0.991517           7.40217    int16     
Conv_174                     BPU  id(2)     HzSQuantizedConv               0.993903           4.27314    int16     
Add_175                      BPU  id(2)     HzSElementwiseAdd              0.994255           6.71794    int8      
Conv_176                     BPU  id(1)     HzSQuantizedConv               0.991987           7.40217    int16     
598_calibrated_Requantize    BPU  id(2)     HzRequantize                   --                 --         int16     
Concat_178                   BPU  id(2)     Concat                         0.988609           4.70882    int16     
Conv_179                     BPU  id(2)     HzSQuantizedConv               0.992529           4.70882    int16     
Conv_181                     BPU  id(2)     HzSQuantizedConv               0.992089           3.59536    int8      
Resize_191                   BPU  id(2)     HzQuantizedRoiResize           0.993308           3.71989    int8      
Conv_192                     BPU  id(2)     HzSQuantizedConv               0.994829           3.71989    int8      
Conv_194                     BPU  id(2)     HzSQuantizedConv               0.992605           3.43919    int8      
Resize_204                   BPU  id(2)     HzQuantizedRoiResize           0.992954           3.53496    int8      
Conv_205                     BPU  id(2)     HzSQuantizedConv               0.994314           3.53496    int8      
Conv_207                     BPU  id(2)     HzSQuantizedConv               0.992073           2.89034    int8      
Conv_209                     BPU  id(2)     HzSQuantizedConv               0.994043           3.29272    int8      
Conv_211                     BPU  id(2)     HzSQuantizedConv               0.991155           3.982      int8      
Resize_220                   CPU  --        Resize                         0.994589           17.5442    float     
Resize_229                   CPU  --        Resize                         0.994637           27.7145    float     
Sigmoid_230                  BPU  id(2)     HzLut2Layer                    0.999832           11.0903    int16     
Slice_249                    BPU  id(3)     Slice                          0.995155           17.5442    int16     
ReduceMax_250                BPU  id(3)     HzQuantizedReduceMax           0.994181           17.5442    int16     
Slice_255                    BPU  id(3)     Slice                          0.993802           27.7145    int8      
ReduceMax_256                BPU  id(3)     HzQuantizedReduceMax           0.996713           27.7145    int8      
Add_258                      BPU  id(3)     HzSElementwiseAdd              0.996714           27.7145    int8      
Less_259                     BPU  id(3)     HzQuantizedComparison          0.984464           23.7483    int16     
711_Cast                     CPU  --        Cast                           --                 --         float     
Where_263_cast               CPU  --        Cast                           0.993772           --         bool      
Where_263_mul_x              BPU  id(4)     HzSElementwiseMul              0.993772           127.0      int8      
Where_263_equal              CPU  --        Equal                          0.984464           127.0      float     
Where_263_equal_output_cast  CPU  --        Cast                           0.984464           --         bool      
Where_263_mul_y              BPU  id(5)     HzSElementwiseMul              0.993034           127.0      int16     
Where_263_add                CPU  --        Add                            0.993772           10000.0    float     
ScatterND_337                CPU  --        ScatterND                      0.999055           --         float     
Gather_339                   BPU  id(7)     Gather                         0.999649           10000.0    int8      
Where_340_cast               CPU  --        Cast                           0.993772           --         bool      
Where_340_mul_x              BPU  id(6)     HzSElementwiseMul              0.987297           127.0      int8      
Where_340_equal              CPU  --        Equal                          0.984464           127.0      float     
Where_340_equal_output_cast  CPU  --        Cast                           0.984464           --         bool      
Where_340_mul_y              BPU  id(7)     HzSElementwiseMul              0.984463           127.0      int8      
Where_340_add                CPU  --        Add                            0.984463           20.0771    float     
ScatterND_414                CPU  --        ScatterND                      0.987190           --         float
2026-04-21 18:22:17,710 file: print_info_dict.py func: print_info_dict line No: 72 The quantized model output:
===============================================================================
Output        Cosine Similarity  L1 Distance  L2 Distance  Chebyshev Distance  
-------------------------------------------------------------------------------
segmentation  0.987190           83.290046    0.490168     10008.679688        
depth         0.999832           0.002285     0.000028     0.634492
2026-04-21 18:22:17,741 file: model_builder.py func: model_builder line No: 38 End to Horizon NN Model Convert.
2026-04-21 18:22:17,835 file: hb_mapper_makertbin.py func: hb_mapper_makertbin line No: 601 start convert to *.bin file....
2026-04-21 18:22:17,855 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4326 ONNX model output num : 2
2026-04-21 18:22:21,080 file: layout_util.py func: layout_util line No: 15 set_featuremap_layout start
2026-04-21 18:22:21,080 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4060 model_deps_info: {'hb_mapper_version': '1.24.3', 'hbdk_version': '3.49.15', 'hbdk_runtime_version': ' 3.15.55.0', 'horizon_nn_version': '1.1.0', 'onnx_model': '/open_explorer/test_lraspp_model_0421/lraspp_99_torch110.onnx', 'march': 'bayes-e', 'layer_out_dump': False, 'log_level': 'DEBUG', 'working_dir': '/open_explorer/test_lraspp_model_0421/hb_mapper_output_3/lraspp_99_torch110_3', 'model_prefix': 'lraspp_99_torch110_3', 'node_info': {'Conv_16': {'ON': 'CPU'}, 'Conv_14': {'ON': 'CPU'}, 'Conv_12': {'ON': 'CPU'}, 'Conv_9': {'ON': 'CPU'}, 'Conv_170': {'ON': 'BPU', 'InputType': 'int16', 'OutputType': 'int16'}, 'Conv_171': {'ON': 'BPU', 'InputType': 'int16', 'OutputType': 'int16'}, 'Resize_220': {'ON': 'CPU'}, 'Resize_229': {'ON': 'CPU'}, 'Where_263_add': {'ON': 'CPU'}, 'Where_340_add': {'ON': 'CPU'}, 'ScatterND_337': {'ON': 'CPU'}, 'ScatterND_414': {'ON': 'CPU'}}, 'input_names': ['input'], 'input_type_rt': ['featuremap'], 'input_space_and_range': ['regular'], 'input_type_train': ['featuremap'], 'input_layout_rt': ['NCHW'], 'input_layout_train': ['NCHW'], 'norm_type': ['no_preprocess'], 'scale_value': [''], 'mean_value': [''], 'input_shape': ['1x5x360x640'], 'input_batch': ['1'], 'cal_dir': ['/open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32'], 'cal_data_type': ['float32'], 'preprocess_on': False, 'calibration_type': 'max', 'per_channel': 'True', 'max_percentile': 0.9999, 'hbdk_params': {'hbdk_pass_through_params': '--O3 --core-num 1 --fast ', 'input-source': {'input': 'ddr', '_default_value': 'ddr'}}, 'debug': False, 'compile_mode': 'latency'}
2026-04-21 18:22:21,080 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4183 ############# model deps info #############
2026-04-21 18:22:21,080 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4184 hb_mapper version   : 1.24.3
2026-04-21 18:22:21,081 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4187 hbdk version        : 3.49.15
2026-04-21 18:22:21,081 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4189 hbdk runtime version: 3.15.55.0
2026-04-21 18:22:21,081 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4192 horizon_nn version  : 1.1.0
2026-04-21 18:22:21,081 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4196 ############# model_parameters info #############
2026-04-21 18:22:21,081 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4202 onnx_model          : /open_explorer/test_lraspp_model_0421/lraspp_99_torch110.onnx
2026-04-21 18:22:21,081 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4203 BPU march           : bayes-e
2026-04-21 18:22:21,081 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4204 layer_out_dump      : False
2026-04-21 18:22:21,081 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4205 log_level           : DEBUG
2026-04-21 18:22:21,081 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4206 working dir         : /open_explorer/test_lraspp_model_0421/hb_mapper_output_3/lraspp_99_torch110_3
2026-04-21 18:22:21,081 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4207 output_model_file_prefix: lraspp_99_torch110_3
2026-04-21 18:22:21,081 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4226 node info  : {'Conv_16': {'ON': 'CPU'}, 'Conv_14': {'ON': 'CPU'}, 'Conv_12': {'ON': 'CPU'}, 'Conv_9': {'ON': 'CPU'}, 'Conv_170': {'ON': 'BPU', 'InputType': 'int16', 'OutputType': 'int16'}, 'Conv_171': {'ON': 'BPU', 'InputType': 'int16', 'OutputType': 'int16'}, 'Resize_220': {'ON': 'CPU'}, 'Resize_229': {'ON': 'CPU'}, 'Where_263_add': {'ON': 'CPU'}, 'Where_340_add': {'ON': 'CPU'}, 'ScatterND_337': {'ON': 'CPU'}, 'ScatterND_414': {'ON': 'CPU'}}
2026-04-21 18:22:21,081 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4228 ############# input_parameters info #############
2026-04-21 18:22:21,081 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4246 ------------------------------------------
2026-04-21 18:22:21,082 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4248 ---------input info : input ---------
2026-04-21 18:22:21,082 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4249 input_name          : input
2026-04-21 18:22:21,082 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4250 input_type_rt       : featuremap
2026-04-21 18:22:21,082 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4252 input_space&range   : regular
2026-04-21 18:22:21,082 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4254 input_layout_rt     : NCHW
2026-04-21 18:22:21,082 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4255 input_type_train    : featuremap
2026-04-21 18:22:21,082 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4256 input_layout_train  : NCHW
2026-04-21 18:22:21,082 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4257 norm_type           : no_preprocess
2026-04-21 18:22:21,082 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4258 input_shape         : 1x5x360x640
2026-04-21 18:22:21,082 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4260 input_batch         : 1
2026-04-21 18:22:21,082 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4268 cal_data_dir        : /open_explorer/test_lraspp_model_0421/hb_calibration_data1_f32
2026-04-21 18:22:21,082 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4270 cal_data_type       : float32
2026-04-21 18:22:21,082 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4271 ---------input info : input end -------
2026-04-21 18:22:21,082 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4272 ------------------------------------------
2026-04-21 18:22:21,082 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4274 ############# calibration_parameters info #############
2026-04-21 18:22:21,082 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4275 preprocess_on       : False
2026-04-21 18:22:21,083 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4276 calibration_type:   : max
2026-04-21 18:22:21,083 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4281 max_percentile      : 0.9999
2026-04-21 18:22:21,083 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4284 per_channel         : True
2026-04-21 18:22:21,083 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4303 ############# compiler_parameters info #############
2026-04-21 18:22:21,083 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4305 debug               : False
2026-04-21 18:22:21,083 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4307 compile_mode        : latency
2026-04-21 18:22:21,083 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4310 hbdk_pass_through_params: --O3 --core-num 1 --fast
2026-04-21 18:22:21,083 file: onnx2horizonrt.py func: onnx2horizonrt line No: 4310 input-source        : {'input': 'ddr', '_default_value': 'ddr'}
2026-04-21 18:22:21,468 file: hb_mapper_makertbin.py func: hb_mapper_makertbin line No: 783 Convert to runtime bin file successfully!
2026-04-21 18:22:21,469 file: hb_mapper_makertbin.py func: hb_mapper_makertbin line No: 784 End Model Convert

您好,建议优先将校准方法由 max 切换为 kl 或启用自动搜索,并增加校准数据的多样性,若精度仍不足,则通过节点级分析定位 Segmentation 分支的敏感算子并配置为 INT16 或 CPU 运行。参考链接:

感谢提供的建议 校验后继续进行反馈。我请教一个问题,目前测试的中间产物*_quantized_model.onnx的效果与原始的.onnx模型效果相差不大。但是将最终产物.bin模型部署到板端测试,效果相差很大,这种现象是正常的吗?需要怎么定位?根据文档,*_quantized_model.onnx与.bin模型的效果应该基本一致才对。

补充一下:我使用的 python脚本做的推理效果测试,是需要用C++做推理吗?

官方提供的说明文档也是这么说明的:

使用工具hb_verifier对比*_quantized_model.onnx与.bin模型,也是会提示严重不符

这是原始模型onnx最后这段语义的结构,有什么改进的建议吗?麻烦提供一下指导

板端的python脚本? 板端的话需要使用 hbm_runtime这个库,最新的3.5.0的镜像

手册3.6章节 BPU 算法接口手册 | RDK DOC

那问题可能是

CPU/BPU 异构调度导致的“重量化”误差

日志显示模型被切分成了多个 Subgraph,且存在大量 CPU 算子。

  • 机制
    • *_quantized_model.onnx 是在 x86 CPU 上通过 ONNX Runtime 模拟运行的。它模拟的是“理想量化”,即:BPU 算子输出 int8 → 反量化为 float32 → 输入给 CPU 算子 → CPU 算子输出 float32 → 量化为 int8 → 输入给下一个 BPU 算子。
    • .bin 是板端实际运行。在 BPU 和 CPU 切换时,数据需要在 DDR 中传输。如果编译器生成的 反量化(Dequantize)重量化(Requantize) 参数(Scale/ZeroPoint)与 ONNX 模拟时的逻辑有细微偏差(例如对齐方式、舍入模式 RoundHalfToEven vs RoundHalfUp),误差会在多次 BPU<->CPU 切换中累积。
    • 特别是 ScatterNDWhere:这些算子在 CPU 上运行浮点逻辑,对输入数据的精度极其敏感。如果前一级 BPU 传过来的 int8 数据在反量化时丢失了低位信息,Equal 比较就会出错,导致 ScatterND 写入错误的位置,最终导致分割结果完全错乱(均值/方差剧烈变化)。
  • 验证方法
    使用 hb_verifier 进行分阶段对比,定位是哪一次 BPU->CPU 或 CPU->BPU 的切换引入了巨大误差。
    hb_verifier 会输出每一层的 Cosine Similarity 和 L1/L2 Error

好的 感谢提供的建议 我梳理对比一下

根据你的日志和现象,这是典型的 CPU/BPU 异构量化误差累积问题。*_quantized_model.onnx 是理想量化模拟,.bin 是板端实际运行,两者在 BPU<->CPU 切换时的反量化/重量化逻辑差异会导致误差累积。

:magnifying_glass_tilted_left: 问题定位步骤

1. 使用 hb_verifier 分阶段对比

# 分 Subgraph 对比,定位误差来源
hb_verifier \
  --original_model lraspp_99_torch110.onnx \
  --quantized_model lraspp_99_torch110_3_quantized_model.onnx \
  --bin_model lraspp_99_torch110_3.bin \
  --calibration_data ../hb_calibration_data1_f32 \
  --layer_wise_compare \
  --output_dir verifier_output

重点关注输出中 Cosine Similarity 骤降 的层,通常是 BPU->CPU 或 CPU->BPU 的切换点。

2. 检查日志中的关键信息

从你的日志看,有几个风险点:

风险点 说明
8 个子图切分 Subgraph_0 ~ Subgraph_7,每次切换都有量化误差
ScatterND/Where 在 CPU 对输入精度极其敏感,前级 BPU 反量化误差会导致索引错误
Conv_170/171 强制 int16 可能与前后级 int8 数据格式不匹配
segmentation 输出 L1 Distance=83.29 误差过大,说明语义分支有严重问题

:hammer_and_wrench: 优化方案

方案 A:减少 CPU/BPU 切换(推荐优先尝试)

将语义分割分支的关键算子全部放到 CPU全部放到 BPU

model_parameters:
  node_info: {
    # 方案 A1:关键路径全部 CPU
    "Conv_170": {'ON': 'CPU'},
    "Conv_171": {'ON': 'CPU'},
    "Add_172": {'ON': 'CPU'},
    "Concat_178": {'ON': 'CPU'},
    "Conv_179": {'ON': 'CPU'},
    "Sigmoid_230": {'ON': 'CPU'},
    "ScatterND_337": {'ON': 'CPU'},
    "ScatterND_414": {'ON': 'CPU'},
    "Where_263_add": {'ON': 'CPU'},
    "Where_340_add": {'ON': 'CPU'},
  }

model_parameters:
  node_info: {
    # 方案 A2:关键路径全部 BPU(需要算子支持)
    "ScatterND_337": {'ON': 'BPU'},  # 如支持
    "ScatterND_414": {'ON': 'BPU'},
    "Where_263_add": {'ON': 'BPU'},
    "Where_340_add": {'ON': 'BPU'},
  }

方案 B:敏感算子使用 INT16

model_parameters:
  node_info: {
    # 将语义分支相关算子全部配置为 int16
    "Conv_170": {'ON': 'BPU', 'InputType': 'int16', 'OutputType': 'int16'},
    "Conv_171": {'ON': 'BPU', 'InputType': 'int16', 'OutputType': 'int16'},
    "Add_172": {'ON': 'BPU', 'InputType': 'int16', 'OutputType': 'int16'},
    "Concat_178": {'ON': 'BPU', 'InputType': 'int16', 'OutputType': 'int16'},
    "Conv_179": {'ON': 'BPU', 'InputType': 'int16', 'OutputType': 'int16'},
    "Sigmoid_230": {'ON': 'BPU', 'InputType': 'int16', 'OutputType': 'int16'},
  }

方案 C:改进校准策略

calibration_parameters:
  calibration_type: 'kl'  # 从 max 改为 kl
  per_channel: True
  max_percentile: 0.9999
  # 增加校准数据多样性(建议 200-500 张)
  cal_data_dir: '../hb_calibration_data_enhanced_f32'

方案 D:检查校准数据质量

# 验证校准数据统计分布
import numpy as np

cal_files = glob('../hb_calibration_data1_f32/*.bin')
for f in cal_files[:10]:
    data = np.fromfile(f, dtype=np.float32).reshape(1, 5, 360, 640)
    print(f"{f}: mean={data.mean():.4f}, std={data.std():.4f}, "
          f"min={data.min():.4f}, max={data.max():.4f}")
    # 检查 5 个通道的分布是否合理
    for c in range(5):
        ch_data = data[0, c, :, :]
        print(f"  Channel {c}: mean={ch_data.mean():.4f}, std={ch_data.std():.4f}")

:clipboard: 排查清单

  • 使用 hb_verifier --layer_wise_compare 定位误差最大的 Subgraph
  • 尝试将 ScatterND/Where 相关算子全部放到 CPU
  • 尝试将校准方法从 max 改为 kl
  • 增加校准数据数量到 200+,确保覆盖不同场景
  • 检查校准数据的 5 个通道(RGB + radar_range + radar_valid_mask)预处理是否与推理时完全一致
  • 尝试移除 Conv_170/171 的强制 int16 配置,让工具自动选择

:books: 参考文档

建议先从方案 A开始,减少 CPU/BPU 切换次数,通常能解决大部分此类问题。有进展欢迎反馈!

这啥意思 我直接使用的是from hobot_dnn import pyeasy_dnn as dnn 这个推理的,官方提供的zoo样例 yolo11-seg里面也是在板端用这个来做推理的,我是RDK-X5的设备

你好,原接口对featuremap兼容不好,所以推出了接口

您的意思是 我需要更新板子的版本到 3.5.0版本吗? 我当前板子安装的提供版本是3.0.0的版本

是的,你需要升级到 RDK OS 3.5.0 版本。

:bullseye: 问题原因

你的模型是 5 通道 featuremap 输入(RGB + radar_range + radar_valid_mask),这种特殊输入格式在 RDK OS 3.0.0 的 hobot_dnn 库中支持不完善:

版本 推理库 featuremap 支持 建议
3.0.0 hobot_dnn :cross_mark: 兼容性问题多 不推荐用于复杂输入
3.5.0 hbm_runtime :white_check_mark: 完整支持 推荐使用

:clipboard: 升级步骤

1. 获取 3.5.0 镜像

从地平线开发者平台下载最新的 RDK OS 3.5.0 镜像:

2. 烧录系统

# 准备 SD 卡(建议 32GB+)
# 解压镜像
unxz rdk_x5_ubuntu_3.5.0.img.xz

# 烧录到 SD 卡(假设 SD 卡设备为 /dev/sdX,请根据实际情况修改)
sudo dd if=rdk_x5_ubuntu_3.5.0.img of=/dev/sdX bs=4M status=progress

# 同步并安全弹出
sync
sudo eject /dev/sdX

3. 验证升级

# 启动开发板后检查版本
cat /etc/version
# 应该显示 3.5.0 或更高

# 验证 hbm_runtime 库可用
python3 -c "from hbm_runtime import HB_HBMRuntime; print('OK')"

:counterclockwise_arrows_button: 代码迁移(3.0.0 → 3.5.0)

当前代码(3.0.0 - hobot_dnn)

from hobot_dnn import pyeasy_dnn as dnn

# 加载模型
model_path = "lraspp_99_torch110_3.bin"
net = dnn.Network(model_path)

# 推理
outputs = net.inference(input_data)

新代码(3.5.0 - hbm_runtime)

from hbm_runtime import HB_HBMRuntime
import numpy as np

# 初始化 Runtime
runtime = HB_HBMRuntime()

# 加载模型
model_path = "lraspp_99_torch110_3.bin"
runtime.load_model(model_path)

# 准备输入(注意:featuremap 需要保持 NCHW 格式)
input_data = np.fromfile("input.bin", dtype=np.float32).reshape(1, 5, 360, 640)

# 推理
outputs = runtime.inference([input_data])

# 获取输出
segmentation = outputs[0]  # 语义分割输出
depth = outputs[1]         # 深度输出

:warning: 注意事项

  1. 数据格式一致性

    • 确保板端推理的输入数据预处理与校准数据完全一致
    • 5 通道顺序:[RGB(0-2), radar_range(3), radar_valid_mask(4)]
  2. 输入布局

    • 3.5.0 默认使用 NCHW 布局(与你的配置文件一致)
    • 不需要额外的 transpose 操作
  3. 精度验证

    • 升级后先用 hb_verifier 验证 .bin 模型与 quantized_model.onnx 的一致性
    • 如果仍有较大偏差,再按之前建议优化 CPU/BPU 调度策略

:books: 参考文档

建议优先升级系统版本,这很可能直接解决你的精度问题。升级后如果仍有偏差,我们再进一步优化模型配置。

3.5 0有新的python 接口提供,如果使用C接口也不确认是否更目前工具链对应,3.0.0应该是很久之前的系统了

1 个赞

3.5最新的版本我看官网是 04-09号的版本?是指这个版本吗?

是的,就是这个版本!rdk-x5-ubuntu22-preinstalled-desktop-3.5.0-arm64... 是正确的。

:white_check_mark: 版本选择建议

镜像文件 适用场景 推荐
desktop 版本 带桌面环境,方便调试 :star: 推荐(开发阶段)
server 版本 无桌面,资源占用少 部署阶段

你截图中的 desktop 版本 适合开发调试,直接使用即可。

:clipboard: 升级前准备

# 1. 备份当前板子上的重要数据
scp -r ~/your_project user@backup_server:/backup/path

# 2. 下载镜像(约 2.7GB)
wget https://downloads.os.horizon.ai/rdk_x5/rdk_os_3.5.0-2026-4-9/rdk-x5-ubuntu22-preinstalled-desktop-3.5.0-arm64.img.xz

# 3. 解压
unxz rdk-x5-ubuntu22-preinstalled-desktop-3.5.0-arm64.img.xz

:wrench: 烧录步骤

# 1. 插入 SD 卡,查看设备名
lsblk  # 确认 SD 卡设备,如 /dev/sdb

# 2. 烧录(⚠️ 确认设备名,避免误操作)
sudo dd if=rdk-x5-ubuntu22-preinstalled-desktop-3.5.0-arm64.img of=/dev/sdX bs=4M status=progress

# 3. 同步并弹出
sync && sudo eject /dev/sdX

:white_check_mark: 升级后验证

# 1. 检查系统版本
cat /etc/version  # 应显示 3.5.0

# 2. 验证 hbm_runtime 可用
python3 -c "from hbm_runtime import HB_HBMRuntime; print('hbm_runtime OK')"

# 3. 验证模型推理
python3 your_inference_script.py

:warning: 注意事项

  1. 升级后需要重新配置环境(Python 包、项目代码等)
  2. 建议先在测试板上验证,确认无误后再部署到生产板
  3. 保留 3.0.0 的 SD 卡作为备份,方便回退

升级完成后,用 hbm_runtime 重新测试你的模型,精度问题应该会有明显改善。有进展随时反馈!

目前RDK系统由3.0.0升级到3.5.0版本后,板端部署的精度与*_quantized_model.onnx**量化模型精度基本一致;核心问题在于:**当前系统版本是初始版本,对于featuremap数据的输入支持比较差

恭喜问题解决!:tada: 这是一个非常典型的系统版本兼容性导致精度异常的案例。

:pushpin: 问题根因总结

环节 现象 根因
ONNX → quantized_model.onnx :white_check_mark: 精度正常 x86 上 ONNX Runtime 模拟量化,逻辑正确
quantized_model.onnx → .bin :cross_mark: 精度失真 RDK OS 3.0.0 的 hobot_dnnfeaturemap 多通道输入支持不完善
升级 3.5.0 后 :white_check_mark: 精度恢复 hbm_runtime 完整支持 featuremap 输入格式

:wrench: 后续优化建议

虽然精度已对齐,但日志显示 segmentation 输出的 Cosine Similarity = 0.987 仍有提升空间,可继续优化:

1. 校准策略优化

calibration_parameters:
  calibration_type: 'kl'  # 从 max 改为 kl
  per_channel: True
  # 校准数据增加到 200-500 张,覆盖更多场景
  cal_data_dir: '../hb_calibration_data_enhanced_f32'

2. 敏感算子配置

如果精度仍需提升,可尝试将语义分割分支的关键算子强制为 int16

model_parameters:
  node_info: {
    "Conv_170": {'ON': 'BPU', 'InputType': 'int16', 'OutputType': 'int16'},
    "Conv_171": {'ON': 'BPU', 'InputType': 'int16', 'OutputType': 'int16'},
    "Sigmoid_230": {'ON': 'BPU', 'InputType': 'int16', 'OutputType': 'int16'},
  }

3. 推理代码示例(3.5.0)

from hbm_runtime import HB_HBMRuntime
import numpy as np

runtime = HB_HBMRuntime()
runtime.load_model("lraspp_99_torch110_3.bin")

# 5 通道 featuremap 输入 (NCHW)
input_data = np.fromfile("input.bin", dtype=np.float32).reshape(1, 5, 360, 640)

outputs = runtime.inference([input_data])
segmentation = outputs[0]
depth = outputs[1]

:warning: 重要提醒

  1. 校准数据一致性:确保板端推理的输入预处理与校准数据完全一致(5 通道顺序、归一化方式)
  2. 版本记录:建议在项目文档中记录 RDK OS 3.5.0+ 为最低要求
  3. 回归测试:后续模型更新时,用 hb_verifier 做快速验证

:books: 建议沉淀到社区

你的排查过程非常有价值,建议:

  • 在本帖更新最终解决方案(方便后续遇到类似问题的开发者)
  • 可补充一篇featuremap 模型部署注意事项的分享帖

有其他问题随时交流!:rocket: