Updated on 2022-03-13 GMT+08:00

Configuration File Template

Quantization is supported in single-input and multi-input network scenarios. You can use this configuration file template directly or make modifications as required for adaptation. Note that some of the parameters in the configuration file are mandatory. Description of the Configuration Parameters describes the parameters in the configuration file and whether a parameter is mandatory.

The configuration file cannot contain Chinese characters.

Single-Input Network Scenario

With the image input, the omg command specifies the quantization configuration. The following is an example of the configuration file:

device:USE_CPU
quantize_algo:HALF_OFFSET
weight_type:VECTOR_TYPE
bin:150
type:KL
inference_with_data_quantized:false
inference_with_weight_quantized:true
super_parameter:
{
min_percentile:PERCENTILE_HIGH
max_percentile:PERCENTILE_MID
start_ratio:0.7
end_ratio:1.3
step_ratio:0.01
}
exclude_op:'fc1000'
batch_count:50
preprocess_parameter:
{
input_type:IMAGE
image_format:BGR
input_file_path:'calibration/image_set'
mean_value:104.0
mean_value:117.0
mean_value:123.0
standard_deviation:1.0
}

Multi-Input Network Scenario

With image+binary inputs, the omg command specifies the quantization configuration. The following is an example of the configuration file:

device:USE_CPU
quantize_algo:HALF_OFFSET
weight_type:VECTOR_TYPE
bin:150
type:KL
inference_with_data_quantized:false
inference_with_weight_quantized:true
super_parameter:
{
min_percentile:PERCENTILE_HIGH
max_percentile:PERCENTILE_MID
start_ratio:0.7
end_ratio:1.3
step_ratio:0.01
}
exclude_op:'fc1000'
batch_count:50
preprocess_parameter:
{
input_type:IMAGE
image_format:BGR
input_file_path:'calibration/image_set'
mean_value:104.0
mean_value:117.0
mean_value:123.0
standard_deviation:1.0
}
preprocess_parameter:
{
input_type:BINARY 
input_file_path:'calibration/img_info.bin'
}