Skip to content

Commit

Permalink
Merge pull request #814 from wuyefeilin/benchmark_amp_dis
Browse files Browse the repository at this point in the history
update some
  • Loading branch information
wuyefeilin authored Feb 1, 2021
2 parents dddeec3 + ad006be commit 885be06
Showing 28 changed files with 81 additions and 698 deletions.
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

## 动态图

通过**--fp16**开启amp训练。
通过 **--fp16** 开启amp训练。

单机单卡使用如下命令进行训练:
```
@@ -16,24 +16,23 @@ export CUDA_VISIBLE_DEVICES=0,1
python -m paddle.distributed.launch train.py --config benchmark/hrnet.yml --iters 2000 --log_iters 10 --fp16
```

deeplabv3p 模型的配置文件为:
benchmark/deeplabv3p.yml

## 静态图

**MODEL.FP16 True**开启amp训练
通过 **MODEL.FP16 True** 开启amp训练
单机单卡使用如下命令进行训练:
```
cd legacy
export CUDA_VISIBLE_DEVICES=0
python pdseg/train.py --cfg configs/hrnetw18_cityscapes_1024x512_500.yaml --use_gpu --use_mpio --log_steps 10 BATCH_SIZE 2 SOLVER.NUM_EPOCHS 3 MODEL.FP16 True
python pdseg/train.py --cfg configs/hrnetw18_cityscapes_1024x512_215.yaml --use_gpu --use_mpio --log_steps 10 BATCH_SIZE 2 SOLVER.NUM_EPOCHS 3 MODEL.FP16 True
```

单机单卡使用如下命令进行训练:
```
export CUDA_VISIBLE_DEVICES=0,1
python pdseg/train.py --cfg configs/hrnetw18_cityscapes_1024x512_500.yaml --use_gpu --use_mpio --log_steps 10 BATCH_SIZE 4 SOLVER.NUM_EPOCHS 3 MODEL.FP16 True
python pdseg/train.py --cfg configs/hrnetw18_cityscapes_1024x512_215.yaml --use_gpu --use_mpio --log_steps 10 BATCH_SIZE 4 SOLVER.NUM_EPOCHS 3 MODEL.FP16 True
```

deeplabv3p模型的配置文件为:
configs/deeplabv3p_resnet50_vd_cityscapes.yaml
## 竞品
竞品为[mmsegmentation](https://github.com/open-mmlab/mmsegmentation)
对应竞品配置文件为:configs/hrnet/fcn_hr18_512x1024_80k_cityscapes.py
相关执行方式其参考官方仓库。
1 change: 1 addition & 0 deletions benchmark/hrnet.yml
Original file line number Diff line number Diff line change
@@ -29,6 +29,7 @@ model:
type: HRNet_W18
num_classes: 19
backbone_indices: [-1]
bias: False

optimizer:
type: sgd
53 changes: 0 additions & 53 deletions legacy/configs/cityscape_fast_scnn.yaml

This file was deleted.

45 changes: 0 additions & 45 deletions legacy/configs/deepglobe_road_extraction.yaml

This file was deleted.

47 changes: 0 additions & 47 deletions legacy/configs/deeplabv3p_mobilenet-1-0_pet.yaml

This file was deleted.

47 changes: 0 additions & 47 deletions legacy/configs/deeplabv3p_mobilenetv2_cityscapes.yaml

This file was deleted.

58 changes: 0 additions & 58 deletions legacy/configs/deeplabv3p_mobilenetv3_large_cityscapes.yaml

This file was deleted.

10 changes: 5 additions & 5 deletions legacy/configs/deeplabv3p_resnet50_vd_cityscapes.yaml
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ AUG:
SCALE_STEP_SIZE: 0.25 # for stepscaling
MIRROR: True
TO_RGB: True
BATCH_SIZE: 4
BATCH_SIZE: 8
DATASET:
DATA_DIR: "./dataset/cityscapes/"
IMAGE_TYPE: "rgb" # choice rgb or rgba
@@ -35,13 +35,13 @@ MODEL:
OUTPUT_STRIDE: 8
TRAIN:
PRETRAINED_MODEL_DIR: u"pretrained_model/resnet50_vd_imagenet"
MODEL_SAVE_DIR: "saved_model/deeplabv3p_resnet50_vd_bn_cityscapes"
SNAPSHOT_EPOCH: 1
MODEL_SAVE_DIR: "output/deeplabv3p_resnet50_vd_bn_cityscapes"
SNAPSHOT_EPOCH: 10
SYNC_BATCH_NORM: True
TEST:
TEST_MODEL: "saved_model/deeplabv3p_resnet50_vd_bn_cityscapes/final"
TEST_MODEL: "output/deeplabv3p_resnet50_vd_bn_cityscapes/final"
SOLVER:
LR: 0.01
LR_POLICY: "poly"
OPTIMIZER: "sgd"
NUM_EPOCHS: 3
NUM_EPOCHS: 215
44 changes: 0 additions & 44 deletions legacy/configs/deeplabv3p_xception65_cityscapes.yaml

This file was deleted.

Loading

0 comments on commit 885be06

Please sign in to comment.