set_logging_level

Function Usage

Sets the logging levels of the log messages printed to the screen and those saved to the hmct_log/hmct.log file.

Prototype

set_logging_level(print_level='info', save_level='info')

Command-Line Options

Option

Input/Return

Meaning

Restriction

print_level

Input

Log level of the log messages printed to the screen.

  • debug: DEBUG, INFO, WARNING, and ERROR logs.
  • info: INFO, WARNING, and ERROR logs.
  • warning: WARNING and ERROR logs.
  • error: ERROR logs.

Default: info

A string

save_level

Input

Log level of log messages saved to the quant_info.log file.

  • debug: DEBUG, INFO, WARNING, and ERROR logs.
  • info: INFO, WARNING, and ERROR logs.
  • warning: WARNING and ERROR logs.
  • error: ERROR logs.

Default: info

A string

Log Level

Details

DEBUG

Detailed quantization processing information, including the quantization factors (scale and offset) and related debugging information.

INFO

Brief quantization processing information, including the quantized layer name and BN fusion information.

WARNING

Warning messages during quantization.

ERROR

Error messages during quantization.

Log levels are case insensitive. For instance, Info, info, and INFO are all valid values.

Returns

None

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
import amct_tensorflow as amct
amct.set_logging_level(print_level="info", save_level="info")
amct.quantize_model(
     graph=tf.get_default_graph(),
     config_file="./configs/config.json",
     record_file="./record_scale_offset.txt")
   ...
amct.save_model(pb_model="./user_model.pb",
                outputs=["model/outputs"],
                record_file="./record_scale_offset.txt",
                save_path="./inference/model")