set_logging_level

Applicability

Product

Supported

Atlas A3 training series products/Atlas A3 inference series products

x

Atlas A2 training products/Atlas A2 inference products

x

Atlas 200I/500 A2 inference product

x

Atlas inference series products

x

Atlas training products

Description

Sets the log levels of the messages printed to the screen and those saved in the amct_log/amct_tensorflow.log file.

Prototype

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

Parameters

Parameter

Input/Output

Description

print_level

Input

Sets the level of the information to be printed.

  • 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

Sets the level of information saved in 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

Description

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 names 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

Example

 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")