save_compressed_retrain_model
Function Usage
Generates the final static compression combination model based on the retrained model.
Constraints
None
Prototype
save_compressed_retrain_model(pb_model, outputs, record_file, save_path)
Command-Line Options
Option |
Input/Return |
Meaning |
Restriction |
|---|---|---|---|
pb_model |
Input |
PB model with sparsity and quantization operators for inference. |
A string |
outputs |
Input |
List of output operators of the graph. |
A list of strings. |
record_file |
Input |
Directory of the quantization factor record file, including the file name. |
A string |
save_path |
Input |
Path for storing the compressed model. Must include the prefix of the model name, for example, ./quantized_model/*model. |
A string |
Returns
None
Outputs
The compressed model that serves for both accuracy simulation in the TensorFlow environment and inference deployment on Ascend AI Processor.
Calling Example
1 2 | import amct_tensorflow as amct amct.save_compressed_retrain_model(masked_pb_path, [operation_name_1, operation_name_2], './tmp/record.txt', './pb_model/final_model') |
Parent topic: Compression Combination APIs