Skip to content

Commit 13be7c6

Browse files
TingquanGaoroot
and
root
authored
[TIPC] add pp_mobileseg_base_ade20k_512x512_80k to train benchmark (#3221)
Co-authored-by: root <[email protected]>
1 parent 1555c4e commit 13be7c6

File tree

3 files changed

+135
-1
lines changed

3 files changed

+135
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
_base_: '../_base_/ade20k.yml'
2+
3+
batch_size: 16 # total batch size is 32
4+
iters: 80000
5+
6+
train_dataset:
7+
transforms:
8+
- type: ResizeStepScaling
9+
min_scale_factor: 0.5
10+
max_scale_factor: 2.0
11+
scale_step_size: 0.25
12+
- type: RandomPaddingCrop
13+
crop_size: [512, 512]
14+
- type: RandomHorizontalFlip
15+
- type: RandomDistort
16+
brightness_range: 0.4
17+
contrast_range: 0.4
18+
saturation_range: 0.4
19+
- type: Normalize
20+
mean: [0.485, 0.456, 0.406]
21+
std: [0.229, 0.224, 0.225]
22+
23+
val_dataset:
24+
transforms:
25+
- type: Resize
26+
target_size: [2048, 512]
27+
keep_ratio: True
28+
size_divisor: 32
29+
- type: Normalize
30+
mean: [0.485, 0.456, 0.406]
31+
std: [0.229, 0.224, 0.225]
32+
33+
optimizer:
34+
_inherited_: False
35+
type: AdamW
36+
weight_decay: 0.01
37+
custom_cfg:
38+
- name: pos_embed
39+
weight_decay_mult: 0.0
40+
- name: head
41+
lr_multi: 10.0
42+
- name: bn
43+
weight_decay_mult: 0.0
44+
45+
lr_scheduler:
46+
type: PolynomialDecay
47+
learning_rate: 0.0006
48+
end_lr: 0
49+
power: 1.0
50+
warmup_iters: 1500
51+
warmup_start_lr: 1.0e-6
52+
53+
loss:
54+
types:
55+
- type: MixedLoss
56+
losses:
57+
- type: CrossEntropyLoss
58+
- type: LovaszSoftmaxLoss
59+
coef: [0.8, 0.2]
60+
coef: [1]
61+
62+
63+
model:
64+
type: PPMobileSeg
65+
num_classes: 150
66+
backbone:
67+
type: MobileSeg_Base
68+
inj_type: AAMSx8
69+
out_feat_chs: [64, 128, 192]
70+
pretrained: https://bj.bcebos.com/paddleseg/dygraph/ade20k/pp_mobileseg/pretrain/model.pdparams
71+
upsample: intepolate # During exportation, you need to change it to vim for using VIM
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
===========================train_params===========================
2+
model_name:pp_mobileseg
3+
python:python3.7
4+
gpu_list:0|0,1
5+
Global.use_gpu:null|null
6+
--precision:null
7+
--iters:lite_train_lite_infer=20|lite_train_whole_infer=20|whole_train_whole_infer=1000
8+
--save_dir:
9+
--batch_size:lite_train_lite_infer=2|lite_train_whole_infer=2|whole_train_whole_infer=3
10+
--model_path:null
11+
train_model_name:best_model/model.pdparams
12+
train_infer_img_dir:test_tipc/data/cityscapes/cityscapes_val_5.list
13+
--profiler_options:null
14+
##
15+
trainer:norm_train
16+
norm_train:tools/train.py --config test_tipc/configs/pp_mobileseg/pp_mobileseg_base_ade20k_512x512_80k.yml --device gpu --save_interval 500 --seed 100 --num_workers 8
17+
pact_train:null
18+
fpgm_train:null
19+
distill_train:null
20+
null:null
21+
null:null
22+
##
23+
===========================eval_params===========================
24+
eval:null
25+
null:null
26+
##
27+
===========================export_params===========================
28+
--save_dir:
29+
--model_path:
30+
norm_export:tools/export.py --config test_tipc/configs/pp_mobileseg/pp_mobileseg_base_ade20k_512x512_80k.yml
31+
quant_export:null
32+
fpgm_export:null
33+
distill_export:null
34+
export1:null
35+
export2:null
36+
===========================infer_params===========================
37+
infer_model:./test_tipc/output/pp_mobileseg/model.pdparams
38+
infer_export:tools/export.py --config test_tipc/configs/pp_mobileseg/pp_mobileseg_base_ade20k_512x512_80k.yml
39+
infer_quant:False
40+
inference:deploy/python/infer.py --save_dir ./test_tipc/output/pp_mobileseg/
41+
--device:cpu|gpu
42+
--enable_mkldnn:True
43+
--cpu_threads:6
44+
--batch_size:1
45+
--use_trt:False
46+
--precision:fp32
47+
--config:
48+
--image_path:./test_tipc/data/cityscapes/cityscapes_val_5.list
49+
--save_log_path:null
50+
--benchmark:True
51+
--save_dir:
52+
--model_name:pp_mobileseg
53+
===========================infer_benchmark_params==========================
54+
random_infer_input:[{float32,[3,1024,1024]}]
55+
===========================to_static_train_benchmark_params===========================
56+
to_static_train:--opts to_static_training=True
57+
===========================train_benchmark_params==========================
58+
batch_size:4
59+
fp_items:fp32|fp16
60+
epoch:400
61+
--profiler_options:'batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile'
62+
flags:FLAGS_eager_delete_tensor_gb=0.0;FLAGS_fraction_of_gpu_memory_to_use=0.98;FLAGS_conv_workspace_size_limit=4096;FLAGS_cudnn_deterministic=False
63+
log_iters:15;repeats:500

test_tipc/prepare.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ if [ ${MODE} = "benchmark_train" ]; then
175175
rm -rf ./test_tipc/data/coco
176176
wget -nc -P ./test_tipc/data/ https://paddleseg.bj.bcebos.com/tipc/data/mini_coco.zip --no-check-certificate
177177
cd ./test_tipc/data/ && unzip mini_coco.zip && cd -
178-
elif [ ${model_name} = 'vit_adapter' ]; then
178+
elif [ ${model_name} = 'vit_adapter' ] || [ ${model_name} = 'pp_mobileseg' ]; then
179179
rm -rf ./test_tipc/data/ADEChallengeData2016
180180
wget -nc -P ./test_tipc/data/ https://paddleseg.bj.bcebos.com/dataset/ADEChallengeData2016.zip --no-check-certificate
181181
cd ./test_tipc/data/ && unzip ADEChallengeData2016.zip && cd -

0 commit comments

Comments
 (0)