From 397a1d57d2092b59400ab2388506bb03ae46f407 Mon Sep 17 00:00:00 2001 From: shangliang Xu Date: Thu, 4 Nov 2021 10:42:36 +0800 Subject: [PATCH] [benchmark] fix faster rcnn dataloader inconsistence (#4451) --- .../configs/faster_rcnn_r50_fpn_1x_coco.yml | 48 +++++++++++++++++++ benchmark/run_benchmark.sh | 2 +- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 benchmark/configs/faster_rcnn_r50_fpn_1x_coco.yml diff --git a/benchmark/configs/faster_rcnn_r50_fpn_1x_coco.yml b/benchmark/configs/faster_rcnn_r50_fpn_1x_coco.yml new file mode 100644 index 000000000..02f138559 --- /dev/null +++ b/benchmark/configs/faster_rcnn_r50_fpn_1x_coco.yml @@ -0,0 +1,48 @@ +_BASE_: [ + '../../configs/datasets/coco_detection.yml', + '../../configs/runtime.yml', + '../../configs/faster_rcnn/_base_/optimizer_1x.yml', + '../../configs/faster_rcnn/_base_/faster_rcnn_r50_fpn.yml', +] +weights: output/faster_rcnn_r50_fpn_1x_coco/model_final + +worker_num: 2 +TrainReader: + sample_transforms: + - Decode: {} + - Resize: {interp: 2, target_size: [800, 1333], keep_ratio: True} + - RandomFlip: {prob: 0.5} + - NormalizeImage: {is_scale: true, mean: [0.485,0.456,0.406], std: [0.229, 0.224,0.225]} + - Permute: {} + batch_transforms: + - PadBatch: {pad_to_stride: 32} + batch_size: 1 + shuffle: true + drop_last: true + collate_batch: false + + +EvalReader: + sample_transforms: + - Decode: {} + - Resize: {interp: 2, target_size: [800, 1333], keep_ratio: True} + - NormalizeImage: {is_scale: true, mean: [0.485,0.456,0.406], std: [0.229, 0.224,0.225]} + - Permute: {} + batch_transforms: + - PadBatch: {pad_to_stride: 32} + batch_size: 1 + shuffle: false + drop_last: false + + +TestReader: + sample_transforms: + - Decode: {} + - Resize: {interp: 2, target_size: [800, 1333], keep_ratio: True} + - NormalizeImage: {is_scale: true, mean: [0.485,0.456,0.406], std: [0.229, 0.224,0.225]} + - Permute: {} + batch_transforms: + - PadBatch: {pad_to_stride: 32} + batch_size: 1 + shuffle: false + drop_last: false diff --git a/benchmark/run_benchmark.sh b/benchmark/run_benchmark.sh index 350ae82fc..e58bd66b3 100644 --- a/benchmark/run_benchmark.sh +++ b/benchmark/run_benchmark.sh @@ -25,7 +25,7 @@ function _train(){ set_optimizer_lr_mp=" " # parse model_name case ${model_name} in - faster_rcnn) model_yml="configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.yml" + faster_rcnn) model_yml="benchmark/configs/faster_rcnn_r50_fpn_1x_coco.yml" set_optimizer_lr_sp="LearningRate.base_lr=0.001" ;; fcos) model_yml="configs/fcos/fcos_r50_fpn_1x_coco.yml" set_optimizer_lr_sp="LearningRate.base_lr=0.001" ;; -- GitLab