发现问题仍然存在:
OE包:horizon_xj3_open_explorer_v2.4.2_20221227.tar.gz
这是original_float_model.onnx:
这是quantized_model.onnx:
这是配置项:
input_parameters:
input_name: ""
input_type_rt: 'gray'
input_layout_rt: 'NCHW'
input_type_train: 'gray'
input_layout_train: 'NCHW'
以下为hb_mapper_makertbin.log:
2023-01-17 15:52:19,671 file: hb_mapper.py func: hb_mapper line No: 111 Start hb_mapper....
2023-01-17 15:52:19,672 file: hb_mapper.py func: hb_mapper line No: 112 log will be stored in /open_explorer/ddk/samples/ai_toolchain/horizon_model_convert_sample/07_segmentation/13_superpoint_AVM/mapper/hb_mapper_makertbin.log
2023-01-17 15:52:19,672 file: hb_mapper.py func: hb_mapper line No: 113 hbdk version 3.27.1
2023-01-17 15:52:19,672 file: hb_mapper.py func: hb_mapper line No: 114 horizon_nn version 0.12.8
2023-01-17 15:52:19,672 file: hb_mapper.py func: hb_mapper line No: 115 hb_mapper version 1.5.7
2023-01-17 15:52:19,673 file: hb_mapper_makertbin.py func: hb_mapper_makertbin line No: 590 Start Model Convert....
2023-01-17 15:52:19,709 file: mapper_conf_parser.py func: mapper_conf_parser line No: 137 validating model_parameters...
2023-01-17 15:52:19,721 file: mapper_conf_parser.py func: mapper_conf_parser line No: 811 Using abs path /open_explorer/ddk/samples/ai_toolchain/horizon_model_convert_sample/07_segmentation/13_superpoint_AVM/mapper/model_output
2023-01-17 15:52:19,722 file: mapper_conf_parser.py func: mapper_conf_parser line No: 149 validating model_parameters finished
2023-01-17 15:52:19,722 file: mapper_conf_parser.py func: mapper_conf_parser line No: 153 validating input_parameters...
2023-01-17 15:52:19,722 file: helper.py func: helper line No: 124 Model input names: ['input.1']
2023-01-17 15:52:19,722 file: mapper_conf_parser.py func: mapper_conf_parser line No: 273 input num is set to 1 according to input_names
2023-01-17 15:52:19,722 file: mapper_conf_parser.py func: mapper_conf_parser line No: 279 model name missing, using model name from model file: ['input.1']
2023-01-17 15:52:19,722 file: mapper_conf_parser.py func: mapper_conf_parser line No: 325 model input shape missing, using shape from model file: [[1, 1, 360, 640]]
2023-01-17 15:52:19,723 file: mapper_conf_parser.py func: mapper_conf_parser line No: 164 validating input_parameters finished
2023-01-17 15:52:19,723 file: mapper_conf_parser.py func: mapper_conf_parser line No: 168 validating calibration_parameters...
2023-01-17 15:52:19,723 file: mapper_conf_parser.py func: mapper_conf_parser line No: 811 Using abs path /open_explorer/ddk/samples/ai_toolchain/horizon_model_convert_sample/07_segmentation/13_superpoint_AVM/mapper/calibration_data_yuv_f32
2023-01-17 15:52:19,723 file: mapper_conf_parser.py func: mapper_conf_parser line No: 182 validating calibration_parameters finished
2023-01-17 15:52:19,724 file: mapper_conf_parser.py func: mapper_conf_parser line No: 186 validating custom_op...
2023-01-17 15:52:19,724 file: mapper_conf_parser.py func: mapper_conf_parser line No: 724 custom_op does not exist, skipped
2023-01-17 15:52:19,724 file: mapper_conf_parser.py func: mapper_conf_parser line No: 192 validating custom_op finished
2023-01-17 15:52:19,724 file: mapper_conf_parser.py func: mapper_conf_parser line No: 195 validating compiler_parameters...
2023-01-17 15:52:19,724 file: mapper_conf_parser.py func: mapper_conf_parser line No: 201 validating compiler_parameters finished
2023-01-17 15:52:19,724 file: tool_utils.py func: tool_utils line No: 94 setting log file level to INFO
2023-01-17 15:52:19,725 file: loader.py func: loader line No: 44 *******************************************
2023-01-17 15:52:19,725 file: loader.py func: loader line No: 45 First calibration picture name: 1011.rgb
2023-01-17 15:52:19,725 file: loader.py func: loader line No: 47 First calibration picture md5:
2023-01-17 15:52:19,742 file: loader.py func: loader line No: 51 *******************************************
2023-01-17 15:52:21,082 file: build.py func: build line No: 36 [Tue Jan 17 15:52:21 2023] Start to Horizon NN Model Convert.
2023-01-17 15:52:21,082 file: dict_parser.py func: dict_parser line No: 30 Parsing the input parameter:{'input.1': {'input_shape': [1, 1, 360, 640], 'expected_input_type': 'GRAY_128', 'original_input_type': 'GRAY', 'original_input_layout': 'NCHW'}}
2023-01-17 15:52:21,082 file: build.py func: build line No: 237 Parsing the calibration parameter
2023-01-17 15:52:21,083 file: dict_parser.py func: dict_parser line No: 496 Parsing the hbdk parameter:{'hbdk_pass_through_params': '--debug --fast --O3', 'input-source': {'input.1': 'pyramid', '_default_value': 'ddr'}}
2023-01-17 15:52:21,083 file: build.py func: build line No: 143 HorizonNN version: 0.12.8
2023-01-17 15:52:21,083 file: build.py func: build line No: 147 HBDK version: 3.27.1
2023-01-17 15:52:21,084 file: build.py func: build line No: 36 [Tue Jan 17 15:52:21 2023] Start to parse the onnx model.
2023-01-17 15:52:21,124 file: onnx_parser.py func: onnx_parser line No: 146 ONNX model info:
ONNX IR version: 7
Opset version: 10
Input name: input.1, [1, 1, 360, 640]
2023-01-17 15:52:21,159 file: build.py func: build line No: 39 [Tue Jan 17 15:52:21 2023] End to parse the onnx model.
2023-01-17 15:52:21,159 file: build.py func: build line No: 266 Model input names: ['input.1']
2023-01-17 15:52:21,160 file: dict_parser.py func: dict_parser line No: 269 Create a preprocessing operator for input_name input.1 with means=NULL, std=NULL, original_input_layout=NCHW, color convert from 'GRAY' to 'GRAY'.
2023-01-17 15:52:21,185 file: build.py func: build line No: 535 Saving the original float model: superpoint_360x640_original_float_model.onnx.
2023-01-17 15:52:21,186 file: build.py func: build line No: 36 [Tue Jan 17 15:52:21 2023] Start to optimize the model.
2023-01-17 15:52:21,590 file: build.py func: build line No: 39 [Tue Jan 17 15:52:21 2023] End to optimize the model.
2023-01-17 15:52:21,609 file: build.py func: build line No: 546 Saving the optimized model: superpoint_360x640_optimized_float_model.onnx.
2023-01-17 15:52:21,609 file: build.py func: build line No: 36 [Tue Jan 17 15:52:21 2023] Start to calibrate the model.
2023-01-17 15:52:21,663 file: calibration_data_set.py func: calibration_data_set line No: 66 There are 100 samples in the calibration data set.
2023-01-17 15:52:21,665 file: default_calibrater.py func: default_calibrater line No: 145 Run calibration model with default calibration method.
2023-01-17 15:52:36,021 file: calibrater.py func: calibrater line No: 212 Reset batch_size=1 and execute calibration again...
2023-01-17 15:56:42,234 file: calibrater.py func: calibrater line No: 212 Reset batch_size=1 and execute calibration again...
2023-01-17 15:58:51,520 file: default_calibrater.py func: default_calibrater line No: 214 Select max method.
2023-01-17 15:58:51,537 file: build.py func: build line No: 39 [Tue Jan 17 15:58:51 2023] End to calibrate the model.
2023-01-17 15:58:51,538 file: build.py func: build line No: 36 [Tue Jan 17 15:58:51 2023] Start to quantize the model.
2023-01-17 15:59:05,279 file: build.py func: build line No: 39 [Tue Jan 17 15:59:05 2023] End to quantize the model.
2023-01-17 15:59:05,399 file: build.py func: build line No: 560 Saving the quantized model: superpoint_360x640_quantized_model.onnx.
2023-01-17 15:59:05,399 file: build.py func: build line No: 36 [Tue Jan 17 15:59:05 2023] Start to compile the model with march bernoulli2.
2023-01-17 15:59:05,532 file: hybrid_build.py func: hybrid_build line No: 121 Compile submodel: torch-jit-export_subgraph_0
2023-01-17 15:59:05,724 file: hbdk_cc.py func: hbdk_cc line No: 119 hbdk-cc parameters:['--debug', '--fast', '--O3', '--input-layout', 'NHWC', '--output-layout', 'NCHW', '--input-source', 'pyramid']
2023-01-17 16:00:11,789 file: tool_utils.py func: tool_utils line No: 293 consumed time 65.9833
2023-01-17 16:00:11,930 file: hybrid_build.py func: hybrid_build line No: 121 Compile submodel: torch-jit-export_subgraph_1
2023-01-17 16:00:11,946 file: hbdk_cc.py func: hbdk_cc line No: 119 hbdk-cc parameters:['--debug', '--fast', '--O3', '--input-layout', 'NHWC', '--output-layout', 'NCHW', '--input-source', 'ddr']
2023-01-17 16:00:12,085 file: tool_utils.py func: tool_utils line No: 293 consumed time 0.0591384
2023-01-17 16:00:12,329 file: build.py func: build line No: 39 [Tue Jan 17 16:00:12 2023] End to compile the model with march bernoulli2.
2023-01-17 16:00:12,330 file: node_info.py func: node_info line No: 48 The converted model node information:
=======================================================================================================================
Node ON Subgraph Type Cosine Similarity Threshold
-----------------------------------------------------------------------------------------------------------------------
HZ_PREPROCESS_FOR_input.1 BPU id(0) HzSQuantizedPreprocess 0.999969 127.000000
Conv_0 BPU id(0) HzSQuantizedConv 0.999703 248.020279
Conv_2 BPU id(0) HzSQuantizedConv 0.996480 3948.289795
MaxPool_4 BPU id(0) HzQuantizedMaxPool 0.996504 4126.196289
Conv_5 BPU id(0) HzSQuantizedConv 0.996396 4126.196289
Conv_7 BPU id(0) HzSQuantizedConv 0.997623 3794.554443
MaxPool_9 BPU id(0) HzQuantizedMaxPool 0.997982 4953.521973
Conv_10 BPU id(0) HzSQuantizedConv 0.998434 4953.521973
Conv_12 BPU id(0) HzSQuantizedConv 0.998647 4903.882324
MaxPool_14 BPU id(0) HzQuantizedMaxPool 0.998763 4535.457031
Conv_15 BPU id(0) HzSQuantizedConv 0.999016 4535.457031
Conv_17 BPU id(0) HzSQuantizedConv 0.998764 4961.694824
Conv_19 BPU id(0) HzSQuantizedConv 0.995566 4482.320801
Conv_21 BPU id(0) HzSQuantizedConv 0.984199 3315.050537
Conv_22 BPU id(0) HzSQuantizedConv 0.998012 4482.320801
Conv_24 BPU id(0) HzSQuantizedConv 0.993719 9522.942383
Pow_25 BPU id(0) HzLut 0.463822 5114.850098
ReduceSum_26 CPU -- ReduceSum
ReduceSum_26_reshape CPU -- Reshape
Sqrt_27 CPU -- Sqrt
Unsqueeze_28 CPU -- Reshape
Div_29_reciprocal BPU id(1) HzLut 0.785250 25988.332031
Div_29_mul CPU -- Mul 1.000000 5114.850098
2023-01-17 16:00:12,330 file: build.py func: build line No: 619 The quantify model output:
==========================================================================
Node Cosine Similarity L1 Distance L2 Distance Chebyshev Distance
--------------------------------------------------------------------------
Conv_21 0.984199 7.682256 0.020534 62.356224
2023-01-17 16:00:12,330 file: build.py func: build line No: 39 [Tue Jan 17 16:00:12 2023] End to Horizon NN Model Convert.
2023-01-17 16:00:12,366 file: hb_mapper_makertbin.py func: hb_mapper_makertbin line No: 641 start convert to *.bin file....
2023-01-17 16:00:12,446 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2534 ONNX model output num : 2
2023-01-17 16:00:12,447 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2410 ############# model deps info #############
2023-01-17 16:00:12,448 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2412 hb_mapper version : 1.5.7
2023-01-17 16:00:12,448 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2415 hbdk version : 3.27.1
2023-01-17 16:00:12,448 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2417 hbdk runtime version: 3.13.25
2023-01-17 16:00:12,448 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2420 horizon_nn version : 0.12.8
2023-01-17 16:00:12,449 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2423 ############# model_parameters info #############
2023-01-17 16:00:12,449 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2429 onnx_model : /open_explorer/ddk/samples/ai_toolchain/horizon_model_convert_sample/07_segmentation/13_superpoint_AVM/mapper/superpoint.onnx
2023-01-17 16:00:12,450 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2430 BPU march : bernoulli2
2023-01-17 16:00:12,450 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2431 layer_out_dump : False
2023-01-17 16:00:12,450 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2432 log_level : INFO
2023-01-17 16:00:12,450 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2433 working dir : /open_explorer/ddk/samples/ai_toolchain/horizon_model_convert_sample/07_segmentation/13_superpoint_AVM/mapper/model_output
2023-01-17 16:00:12,450 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2434 output_model_file_prefix: superpoint_360x640
2023-01-17 16:00:12,451 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2441 ############# input_parameters info #############
2023-01-17 16:00:12,451 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2458 ------------------------------------------
2023-01-17 16:00:12,451 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2460 ---------input info : input.1 ---------
2023-01-17 16:00:12,452 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2461 input_name : input.1
2023-01-17 16:00:12,452 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2462 input_type_rt : gray
2023-01-17 16:00:12,453 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2465 input_space&range : regular
2023-01-17 16:00:12,453 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2466 input_layout_rt : NCHW
2023-01-17 16:00:12,453 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2467 input_type_train : gray
2023-01-17 16:00:12,453 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2468 input_layout_train : NCHW
2023-01-17 16:00:12,454 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2469 norm_type : no_preprocess
2023-01-17 16:00:12,454 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2470 input_shape : 1x1x360x640
2023-01-17 16:00:12,454 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2478 cal_data_dir : /open_explorer/ddk/samples/ai_toolchain/horizon_model_convert_sample/07_segmentation/13_superpoint_AVM/mapper/calibration_data_yuv_f32
2023-01-17 16:00:12,454 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2479 ---------input info : input.1 end -------
2023-01-17 16:00:12,454 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2480 ------------------------------------------
2023-01-17 16:00:12,455 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2482 ############# calibration_parameters info #############
2023-01-17 16:00:12,456 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2483 preprocess_on : False
2023-01-17 16:00:12,456 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2484 calibration_type: : default
2023-01-17 16:00:12,457 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2508 ############# compiler_parameters info #############
2023-01-17 16:00:12,457 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2512 hbdk_pass_through_params: --debug --fast --O3
2023-01-17 16:00:12,457 file: onnx2horizonrt.py func: onnx2horizonrt line No: 2512 input-source : {'input.1': 'pyramid', '_default_value': 'ddr'}
2023-01-17 16:00:12,470 file: hb_mapper_makertbin.py func: hb_mapper_makertbin line No: 768 Convert to runtime bin file sucessfully!
2023-01-17 16:00:12,470 file: hb_mapper_makertbin.py func: hb_mapper_makertbin line No: 769 End Model Convert