From 253c09b59560e4344d7f4112d6d2e11bd858756f Mon Sep 17 00:00:00 2001 From: zhouzj <41366441+zzjjay@users.noreply.github.com> Date: Sat, 8 Oct 2022 14:02:23 +0800 Subject: [PATCH] fix the config of ssd_mobilenet_v1 (#1443) --- example/auto_compression/detection/README.md | 5 +++++ .../configs/ssd_mbv1_voc_qat_dis.yaml | 21 ++++++++++--------- .../image_classification/README.md | 2 +- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/example/auto_compression/detection/README.md b/example/auto_compression/detection/README.md index 4ca20249..40973d36 100644 --- a/example/auto_compression/detection/README.md +++ b/example/auto_compression/detection/README.md @@ -27,6 +27,11 @@ - mAP的指标均在COCO val2017数据集中评测得到,IoU=0.5:0.95。 - PP-YOLOE-l模型在Tesla V100的GPU环境下测试,并且开启TensorRT,batch_size=1,包含NMS,测试脚本是[benchmark demo](https://github.com/PaddlePaddle/PaddleDetection/tree/release/2.4/deploy/python)。 - PP-YOLOE-s模型在Tesla T4,TensorRT 8.4.1,CUDA 11.2,batch_size=1,不包含NMS,测试脚本是[cpp_infer_ppyoloe](./cpp_infer_ppyoloe)。 +### SSD on Pascal VOC +| 模型 | Box AP | ACT量化Box AP | TRT-FP32 | TRT-INT8 | 配置文件 | 量化模型 | +| :-------- |:-------- | :---------------------: | :----------------: | :---------------: | :----------------------: | :---------------------: | +| SSD-MobileNetv1 | 73.8 | 73.52 | 4.0ms | 1.7ms | [config](https://github.com/PaddlePaddle/PaddleSlim/blob/develop/example/auto_compression/detection/configs/ssd_mbv1_voc_qat_dis.yaml) | [Model](https://bj.bcebos.com/v1/paddle-slim-models/act/ssd_mobilenet_v1_quant.tar) | +- 测速环境:Tesla T4,TensorRT 8.4.1,CUDA 11.2,batch_size=1,包含NMS. ## 3. 自动压缩流程 #### 3.1 准备环境 diff --git a/example/auto_compression/detection/configs/ssd_mbv1_voc_qat_dis.yaml b/example/auto_compression/detection/configs/ssd_mbv1_voc_qat_dis.yaml index 5f8d6853..dc74ec78 100644 --- a/example/auto_compression/detection/configs/ssd_mbv1_voc_qat_dis.yaml +++ b/example/auto_compression/detection/configs/ssd_mbv1_voc_qat_dis.yaml @@ -2,32 +2,33 @@ Global: reader_config: configs/ssd_reader.yml input_list: ['image', 'scale_factor', 'im_shape'] Evaluation: True - model_dir: ./ssd_mobilenet_v1_300_120e_voc + model_dir: ./ssd_mobilenet_v1_300_120e_voc # Model Link: https://bj.bcebos.com/v1/paddle-slim-models/act/ssd_mobilenet_v1_300_120e_voc.tar model_filename: model.pdmodel params_filename: model.pdiparams Distillation: alpha: 1.0 - loss: l2 + loss: soft_label node: - concat_0.tmp_0 - concat_2.tmp_0 + - concat_1.tmp_0 Quantization: - activation_quantize_type: 'range_abs_max' + use_pact: True + weight_quantize_type: 'channel_wise_abs_max' + activation_quantize_type: 'moving_average_abs_max' quantize_op_types: - conv2d - depthwise_conv2d + onnx_format: True TrainConfig: - train_iter: 80000 - eval_iter: 1000 - learning_rate: - type: CosineAnnealingDecay - learning_rate: 0.00001 - T_max: 120000 + epochs: 5 + eval_iter: 300 + learning_rate: 0.001 optimizer_builder: optimizer: type: SGD weight_decay: 4.0e-05 - + origin_metric: 0.738 diff --git a/example/auto_compression/image_classification/README.md b/example/auto_compression/image_classification/README.md index 973c04e5..0d556194 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 | 量化+蒸馏 | 78.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) | - ARM CPU 测试环境:`SDM865(4xA77+4xA55)` - Nvidia GPU 测试环境: -- GitLab