diff --git a/example/auto_compression/image_classification/README.md b/example/auto_compression/image_classification/README.md index 2e77242b4db46d6a381273cf79e84433789a84fc..3917f141526b254fe33697ce570841d697bcb27b 100644 --- a/example/auto_compression/image_classification/README.md +++ b/example/auto_compression/image_classification/README.md @@ -44,7 +44,7 @@ | MobileNetV3_large_x1_0 | Baseline | 75.32 | - | 16.62 | - | [Model](https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/MobileNetV3_large_x1_0_infer.tar) | | MobileNetV3_large_x1_0 | 量化+蒸馏 | 74.04 | - | 9.85 | [Config](./configs/MobileNetV3_large_x1_0/qat_dis.yaml) | [Model](https://paddle-slim-models.bj.bcebos.com/act/MobileNetV3_large_x1_0_QAT.tar) | | MobileNetV3_large_x1_0_ssld | Baseline | 78.96 | - | 16.62 | - | [Model](https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/MobileNetV3_large_x1_0_ssld_infer.tar) | -| MobileNetV3_large_x1_0_ssld | 量化+蒸馏 | 77.17 | - | 9.85 | [Config](./configs/MobileNetV3_large_x1_0/qat_dis.yaml) | [Model](https://paddle-slim-models.bj.bcebos.com/act/MobileNetV3_large_x1_0_ssld_QAT.tar) | +| MobileNetV3_large_x1_0_ssld | 量化+蒸馏 | 77.17 | - | 9.85 | [Config](./configs/MobileNetV3_large_x1_0_ssld/qat_dis.yaml) | [Model](https://paddle-slim-models.bj.bcebos.com/act/MobileNetV3_large_x1_0_ssld_QAT.tar) | | ViT_base_patch16_224 | Baseline | 81.89 | 367.17(batch_size=40) | - | - | [Model](https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/inference/ViT_base_patch16_224_infer.tar) | | ViT_base_patch16_224 | 量化+蒸馏 | 82.05 | 51.70(batch_size=40) | - | [Config](./configs/VIT/qat_dis.yaml) | [Model](https://bj.bcebos.com/v1/paddle-slim-models/act/ViT_base_patch16_224_QAT.tar) | diff --git a/example/auto_compression/image_classification/configs/MobileNetV3_large_x1_0/qat_dis.yaml b/example/auto_compression/image_classification/configs/MobileNetV3_large_x1_0/qat_dis.yaml index 2da27da8db253f87d1a2e928d8740d4d39dab8b9..07a4dee646581ea66b1fac691cbf6301712139e3 100644 --- a/example/auto_compression/image_classification/configs/MobileNetV3_large_x1_0/qat_dis.yaml +++ b/example/auto_compression/image_classification/configs/MobileNetV3_large_x1_0/qat_dis.yaml @@ -1,5 +1,5 @@ Global: - model_dir: MobileNetV3_large_x1_0_ssld_infer + model_dir: MobileNetV3_large_x1_0_infer model_filename: inference.pdmodel params_filename: inference.pdiparams batch_size: 128 diff --git a/example/auto_compression/image_classification/configs/MobileNetV3_large_x1_0_ssld/prune_dis.yaml b/example/auto_compression/image_classification/configs/MobileNetV3_large_x1_0_ssld/prune_dis.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4a848a69daf46b0ae32e5eeec36405c59b22dee9 --- /dev/null +++ b/example/auto_compression/image_classification/configs/MobileNetV3_large_x1_0_ssld/prune_dis.yaml @@ -0,0 +1,36 @@ +Global: + model_dir: MobileNetV3_large_x1_0_ssld_infer + model_filename: inference.pdmodel + params_filename: inference.pdiparams + batch_size: 32 + data_dir: ./ILSVRC2012 + +Distillation: + alpha: 1.0 + loss: l2 + node: + - softmax_0.tmp_0 +UnstructurePrune: + prune_strategy: gmp + prune_mode: ratio + ratio: 0.75 + gmp_config: + stable_iterations: 0 + pruning_iterations: 4500 + tunning_iterations: 4500 + resume_iteration: -1 + pruning_steps: 100 + initial_ratio: 0.15 + prune_params_type: conv1x1_only + local_sparsity: True +TrainConfig: + epochs: 1 + eval_iter: 500 + learning_rate: + type: CosineAnnealingDecay + learning_rate: 0.015 + optimizer_builder: + optimizer: + type: Momentum + weight_decay: 0.00002 + origin_metric: 0.7532 diff --git a/example/auto_compression/image_classification/configs/MobileNetV3_large_x1_0_ssld/qat_dis.yaml b/example/auto_compression/image_classification/configs/MobileNetV3_large_x1_0_ssld/qat_dis.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2da27da8db253f87d1a2e928d8740d4d39dab8b9 --- /dev/null +++ b/example/auto_compression/image_classification/configs/MobileNetV3_large_x1_0_ssld/qat_dis.yaml @@ -0,0 +1,36 @@ +Global: + model_dir: MobileNetV3_large_x1_0_ssld_infer + model_filename: inference.pdmodel + params_filename: inference.pdiparams + batch_size: 128 + data_dir: ./ILSVRC2012 + +Distillation: + alpha: 1.0 + loss: soft_label + +QuantAware: + use_pact: true + activation_bits: 8 + is_full_quantize: false + onnx_format: True + activation_quantize_type: moving_average_abs_max + weight_quantize_type: channel_wise_abs_max + not_quant_pattern: + - skip_quant + quantize_op_types: + - conv2d + - depthwise_conv2d + - matmul + - matmul_v2 + weight_bits: 8 + +TrainConfig: + epochs: 2 + eval_iter: 5000 + learning_rate: 0.001 + optimizer_builder: + optimizer: + type: Momentum + weight_decay: 0.00002 + origin_metric: 0.7896