set_logging_level

Applicable Products

Product

Supported

Ascend 950PR&950DT products

x

Atlas A3 products

x

Atlas A2 products

x

Atlas 200I/500 A2 inference products

x

Atlas inference 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

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

Type: string

save_level

Input

Level of the information saved in the amct_tensorflow.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

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