From bb99cfb88d223439dd9fa0c49976b6e85693e511 Mon Sep 17 00:00:00 2001 From: Guanghua Yu <742925032@qq.com> Date: Fri, 22 Jan 2021 11:57:36 +0800 Subject: [PATCH] Revert "[Dygraph] Fix SSD-MobileNet (#2109)" This reverts commit 5d7f09edce44223ea97cc0405d5190c55c17a110. --- dygraph/configs/ssd/README.md | 2 +- dygraph/configs/ssd/_base_/optimizer_120e.yml | 6 +++--- dygraph/configs/ssd/_base_/ssd_mobilenet_reader.yml | 11 +++++++---- dygraph/configs/ssd/_base_/ssdlite300_reader.yml | 2 +- dygraph/configs/ssd/_base_/ssdlite320_reader.yml | 2 +- dygraph/ppdet/engine/export_utils.py | 6 +++--- 6 files changed, 16 insertions(+), 13 deletions(-) diff --git a/dygraph/configs/ssd/README.md b/dygraph/configs/ssd/README.md index 442fa2c0b..b62eb9dcc 100644 --- a/dygraph/configs/ssd/README.md +++ b/dygraph/configs/ssd/README.md @@ -7,7 +7,7 @@ | 骨架网络 | 网络类型 | 每张GPU图片个数 | 学习率策略 |推理时间(fps) | Box AP | 下载 | 配置文件 | | :-------------- | :------------- | :-----: | :-----: | :------------: | :-----: | :-----------------------------------------------------: | :-----: | | VGG | SSD | 8 | 240e | ---- | 78.2 | [下载链接](https://paddlemodels.bj.bcebos.com/object_detection/dygraph/ssd_vgg16_300_240e_voc.pdparams) | [配置文件](https://github.com/PaddlePaddle/PaddleDetection/tree/master/dygraph/configs/ssd_vgg16_300_240e_voc.yml) | -| MobileNet v1 | SSD | 32 | 120e | ---- | 73.3 | [下载链接](https://paddlemodels.bj.bcebos.com/object_detection/dygraph/ssd_mobilenet_v1_300_120e_voc.pdparams) | [配置文件](https://github.com/PaddlePaddle/PaddleDetection/tree/master/dygraph/configs/ssd_mobilenet_v1_300_120e_voc.yml) | +| MobileNet v1 | SSD | 32 | 120e | ---- | 73.1 | [下载链接](https://paddlemodels.bj.bcebos.com/object_detection/dygraph/ssd_mobilenet_v1_300_120e_voc.pdparams) | [配置文件](https://github.com/PaddlePaddle/PaddleDetection/tree/master/dygraph/configs/ssd_mobilenet_v1_300_120e_voc.yml) | **注意:** SSD-VGG使用4GPU在总batch size为32下训练240个epoch。SSD-MobileNetv1使用2GPU在总batch size为64下训练120周期。 diff --git a/dygraph/configs/ssd/_base_/optimizer_120e.yml b/dygraph/configs/ssd/_base_/optimizer_120e.yml index 0625b6694..908745c6c 100644 --- a/dygraph/configs/ssd/_base_/optimizer_120e.yml +++ b/dygraph/configs/ssd/_base_/optimizer_120e.yml @@ -10,8 +10,8 @@ LearningRate: OptimizerBuilder: optimizer: - momentum: 0.0 - type: RMSProp + momentum: 0.9 + type: Momentum regularizer: - factor: 0.00005 + factor: 0.0005 type: L2 diff --git a/dygraph/configs/ssd/_base_/ssd_mobilenet_reader.yml b/dygraph/configs/ssd/_base_/ssd_mobilenet_reader.yml index 087ea7e68..b43d97d18 100644 --- a/dygraph/configs/ssd/_base_/ssd_mobilenet_reader.yml +++ b/dygraph/configs/ssd/_base_/ssd_mobilenet_reader.yml @@ -2,18 +2,21 @@ worker_num: 8 TrainReader: inputs_def: num_max_boxes: 90 + sample_transforms: - DecodeOp: {} - RandomDistortOp: {brightness: [0.5, 1.125, 0.875], random_apply: False} - RandomExpandOp: {fill_value: [127.5, 127.5, 127.5]} - RandomCropOp: {allow_no_crop: Fasle} - RandomFlipOp: {} - - ResizeOp: {target_size: [300, 300], keep_ratio: False, interp: 1} - NormalizeBoxOp: {} + - ResizeImage: {target_size: 300, interp: 1, use_cv2: false} - PadBoxOp: {num_max_boxes: 90} + batch_transforms: - NormalizeImageOp: {mean: [127.5, 127.5, 127.5], std: [127.502231, 127.502231, 127.502231], is_scale: false} - - Permute: {} + - Permute: {to_bgr: true} + batch_size: 32 shuffle: true drop_last: true @@ -24,7 +27,7 @@ EvalReader: - DecodeOp: {} - ResizeOp: {target_size: [300, 300], keep_ratio: False, interp: 1} - NormalizeImageOp: {mean: [127.5, 127.5, 127.5], std: [127.502231, 127.502231, 127.502231], is_scale: false} - - Permute: {} + - Permute: {to_bgr: true} batch_size: 1 drop_empty: false @@ -36,5 +39,5 @@ TestReader: - DecodeOp: {} - ResizeOp: {target_size: [300, 300], keep_ratio: False, interp: 1} - NormalizeImageOp: {mean: [127.5, 127.5, 127.5], std: [127.502231, 127.502231, 127.502231], is_scale: false} - - Permute: {} + - Permute: {to_bgr: true} batch_size: 1 diff --git a/dygraph/configs/ssd/_base_/ssdlite300_reader.yml b/dygraph/configs/ssd/_base_/ssdlite300_reader.yml index c4f3095b6..bbce81b31 100644 --- a/dygraph/configs/ssd/_base_/ssdlite300_reader.yml +++ b/dygraph/configs/ssd/_base_/ssdlite300_reader.yml @@ -8,8 +8,8 @@ TrainReader: - RandomExpandOp: {fill_value: [123.675, 116.28, 103.53]} - RandomCropOp: {allow_no_crop: Fasle} - RandomFlipOp: {} - - ResizeOp: {target_size: [300, 300], keep_ratio: False, interp: 1} - NormalizeBoxOp: {} + - ResizeImage: {target_size: 300, interp: 1, use_cv2: false} - PadBoxOp: {num_max_boxes: 90} batch_transforms: - NormalizeImageOp: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: true} diff --git a/dygraph/configs/ssd/_base_/ssdlite320_reader.yml b/dygraph/configs/ssd/_base_/ssdlite320_reader.yml index 7c206a933..dd7a0f3bf 100644 --- a/dygraph/configs/ssd/_base_/ssdlite320_reader.yml +++ b/dygraph/configs/ssd/_base_/ssdlite320_reader.yml @@ -8,8 +8,8 @@ TrainReader: - RandomExpandOp: {fill_value: [123.675, 116.28, 103.53]} - RandomCropOp: {allow_no_crop: Fasle} - RandomFlipOp: {} - - ResizeOp: {target_size: [320, 320], keep_ratio: False, interp: 1} - NormalizeBoxOp: {} + - ResizeImage: {target_size: 320, interp: 1, use_cv2: false} - PadBoxOp: {num_max_boxes: 90} batch_transforms: - NormalizeImageOp: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: true} diff --git a/dygraph/ppdet/engine/export_utils.py b/dygraph/ppdet/engine/export_utils.py index 938288d72..d724f179a 100644 --- a/dygraph/ppdet/engine/export_utils.py +++ b/dygraph/ppdet/engine/export_utils.py @@ -28,13 +28,13 @@ logger = setup_logger(__name__) # Global dictionary TRT_MIN_SUBGRAPH = { 'YOLO': 3, - 'SSD': 40, + 'SSD': 3, 'RCNN': 40, 'RetinaNet': 40, 'EfficientDet': 40, 'Face': 3, - 'TTFNet': 40, - 'FCOS': 40, + 'TTFNet': 3, + 'FCOS': 3, 'SOLOv2': 60, } -- GitLab