From 2498da5a0239b17feea804dd9b3f13f04829c702 Mon Sep 17 00:00:00 2001 From: Liufang Sang Date: Thu, 6 Feb 2020 07:18:21 -0600 Subject: [PATCH] add quantization model result in README (#211) --- slim/quantization/README.md | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/slim/quantization/README.md b/slim/quantization/README.md index b9cfb490c..85d4412f9 100644 --- a/slim/quantization/README.md +++ b/slim/quantization/README.md @@ -57,7 +57,7 @@ step2: 开始训练 请在PaddleDetection根目录下运行。 ``` -python slim/quantization/train.py \ +python slim/quantization/train.py --not_quant_pattern yolo_output \ --eval \ -c ./configs/yolov3_mobilenet_v1.yml \ -o max_iters=30000 \ @@ -124,7 +124,7 @@ checkpoint.save(exe, eval_prog, os.path.join(save_dir, save_name)) 评估命令: ``` -python slim/quantization/eval.py -c ./configs/yolov3_mobilenet_v1.yml \ +python slim/quantization/eval.py --not_quant_pattern yolo_output -c ./configs/yolov3_mobilenet_v1.yml \ -o weights=./output/mobilenetv1/yolov3_mobilenet_v1/best_model ``` @@ -139,7 +139,7 @@ python slim/quantization/eval.py -c ./configs/yolov3_mobilenet_v1.yml \ 导出模型命令: ``` - python slim/quantization/export_model.py -c ./configs/yolov3_mobilenet_v1.yml --output_dir ${save path} \ + python slim/quantization/export_model.py --not_quant_pattern yolo_output -c ./configs/yolov3_mobilenet_v1.yml --output_dir ${save path} \ -o weights=./output/mobilenetv1/yolov3_mobilenet_v1/best_model ``` ## 预测 @@ -150,7 +150,7 @@ python slim/quantization/eval.py -c ./configs/yolov3_mobilenet_v1.yml \ 运行命令示例: ``` -python slim/quantization/infer.py \ +python slim/quantization/infer.py --not_quant_pattern yolo_output \ -c ./configs/yolov3_mobilenet_v1.yml \ --infer_dir ./demo \ -o weights=./output/mobilenetv1/yolov3_mobilenet_v1/best_model @@ -161,7 +161,28 @@ python slim/quantization/infer.py \ 导出模型步骤中导出的FP32模型可使用PaddleLite进行加载预测,可参见教程[Paddle-Lite如何加载运行量化模型](https://github.com/PaddlePaddle/Paddle-Lite/wiki/model_quantization) -## 量化结果 +## 量化模型 +### 训练策略 + +- 量化策略`post`为使用离线量化得到的模型,`aware`为在线量化训练得到的模型。 + +### YOLOv3 on COCO + +| 骨架网络 | 预训练权重 | 量化策略 | 输入尺寸 | Box AP | 下载 | +| :----------------| :--------: | :------: | :------: |:------: | :-----------------------------------------------------: | +| MobileNetV1 | ImageNet | post | 608 | 27.9 | [下载链接](https://paddlemodels.bj.bcebos.com/PaddleSlim/yolov3_mobilenetv1_coco_quant_post.tar) | +| MobileNetV1 | ImageNet | post | 416 | 28.0 | [下载链接](https://paddlemodels.bj.bcebos.com/PaddleSlim/yolov3_mobilenetv1_coco_quant_post.tar) | +| MobileNetV1 | ImageNet | post | 320 | 26.0 | [下载链接](https://paddlemodels.bj.bcebos.com/PaddleSlim/yolov3_mobilenetv1_coco_quant_post.tar) | +| MobileNetV1 | ImageNet | aware | 608 | 28.1 | [下载链接](https://paddlemodels.bj.bcebos.com/PaddleSlim/yolov3_mobilenetv1_coco_quant_aware.tar) | +| MobileNetV1 | ImageNet | aware | 416 | 28.2 | [下载链接](https://paddlemodels.bj.bcebos.com/PaddleSlim/yolov3_mobilenetv1_coco_quant_aware.tar) | +| MobileNetV1 | ImageNet | aware | 320 | 25.8 | [下载链接](https://paddlemodels.bj.bcebos.com/PaddleSlim/yolov3_mobilenetv1_coco_quant_aware.tar) | +| ResNet34 | ImageNet | post | 608 | 35.7 | [下载链接](https://paddlemodels.bj.bcebos.com/PaddleSlim/yolov3_r34_coco_quant_post.tar) | +| ResNet34 | ImageNet | aware | 608 | 35.2 | [下载链接](https://paddlemodels.bj.bcebos.com/PaddleSlim/yolov3_r34_coco_quant_aware.tar) | +| ResNet34 | ImageNet | aware | 416 | 33.3 | [下载链接](https://paddlemodels.bj.bcebos.com/PaddleSlim/yolov3_r34_coco_quant_aware.tar) | +| ResNet34 | ImageNet | aware | 320 | 30.3 | [下载链接](https://paddlemodels.bj.bcebos.com/PaddleSlim/yolov3_r34_coco_quant_aware.tar) | +| R50vd-dcn | object365 | aware | 608 | 40.6 | [下载链接](https://paddlemodels.bj.bcebos.com/PaddleSlim/yolov3_r50vd_dcn_obj365_pretrained_coco_quant_aware.tar) | +| R50vd-dcn | object365 | aware | 416 | 37.5 | [下载链接](https://paddlemodels.bj.bcebos.com/PaddleSlim/yolov3_r50vd_dcn_obj365_pretrained_coco_quant_aware.tar) | +| R50vd-dcn | object365 | aware | 320 | 34.1 | [下载链接](https://paddlemodels.bj.bcebos.com/PaddleSlim/yolov3_r50vd_dcn_obj365_pretrained_coco_quant_aware.tar) | ## FAQ -- GitLab