Skip to content

Commit

Permalink
modified batch_size and update_freq & add more tipc_test configs
Browse files Browse the repository at this point in the history
  • Loading branch information
flytocc authored and TingquanGao committed Apr 6, 2023
1 parent 4bdafdb commit a69bc94
Show file tree
Hide file tree
Showing 12 changed files with 207 additions and 33 deletions.
1 change: 0 additions & 1 deletion ppcls/configs/ImageNet/MobileViTv3/MobileViTv3_S.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ Optimizer:
eta_min: 0.0002
warmup_epoch: 1 # 3000 iterations
warmup_start_lr: 0.0002
# by_epoch: True

# data loader for train and eval
DataLoader:
Expand Down
7 changes: 3 additions & 4 deletions ppcls/configs/ImageNet/MobileViTv3/MobileViTv3_S_L2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Global:
image_shape: [3, 256, 256]
save_inference_dir: ./inference
use_dali: False
update_freq: 3 # for 4 gpus

# mixed precision training
AMP:
Expand Down Expand Up @@ -49,13 +50,11 @@ Optimizer:
epsilon: 1e-8
weight_decay: 0.01
lr:
# for 8 cards
name: Cosine
learning_rate: 0.002
learning_rate: 0.002 # for total batch size 384
eta_min: 0.0002
warmup_epoch: 1 # 3000 iterations
warmup_start_lr: 0.0002
# by_epoch: True

# data loader for train and eval
DataLoader:
Expand Down Expand Up @@ -86,7 +85,7 @@ DataLoader:
scales: [256, 160, 192, 224, 288, 320]
# first_bs: batch size for the first image resolution in the scales list
# divide_factor: to ensure the width and height dimensions can be devided by downsampling multiple
first_bs: 48
first_bs: 32
divided_factor: 32
is_training: True
loader:
Expand Down
7 changes: 3 additions & 4 deletions ppcls/configs/ImageNet/MobileViTv3/MobileViTv3_XS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Global:
image_shape: [3, 256, 256]
save_inference_dir: ./inference
use_dali: False
update_freq: 3 # for 4 gpus

# mixed precision training
AMP:
Expand Down Expand Up @@ -49,13 +50,11 @@ Optimizer:
epsilon: 1e-8
weight_decay: 0.01
lr:
# for 8 cards
name: Cosine
learning_rate: 0.002
learning_rate: 0.002 # for total batch size 384
eta_min: 0.0002
warmup_epoch: 1 # 3000 iterations
warmup_start_lr: 0.0002
# by_epoch: True

# data loader for train and eval
DataLoader:
Expand Down Expand Up @@ -86,7 +85,7 @@ DataLoader:
scales: [256, 160, 192, 224, 288, 320]
# first_bs: batch size for the first image resolution in the scales list
# divide_factor: to ensure the width and height dimensions can be devided by downsampling multiple
first_bs: 48
first_bs: 32
divided_factor: 32
is_training: True
loader:
Expand Down
7 changes: 3 additions & 4 deletions ppcls/configs/ImageNet/MobileViTv3/MobileViTv3_XS_L2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Global:
image_shape: [3, 256, 256]
save_inference_dir: ./inference
use_dali: False
update_freq: 3 # for 4 gpus

# mixed precision training
AMP:
Expand Down Expand Up @@ -49,13 +50,11 @@ Optimizer:
epsilon: 1e-8
weight_decay: 0.01
lr:
# for 8 cards
name: Cosine
learning_rate: 0.002
learning_rate: 0.002 # for total batch size 384
eta_min: 0.0002
warmup_epoch: 1 # 3000 iterations
warmup_start_lr: 0.0002
# by_epoch: True

# data loader for train and eval
DataLoader:
Expand Down Expand Up @@ -86,7 +85,7 @@ DataLoader:
scales: [256, 160, 192, 224, 288, 320]
# first_bs: batch size for the first image resolution in the scales list
# divide_factor: to ensure the width and height dimensions can be devided by downsampling multiple
first_bs: 48
first_bs: 32
divided_factor: 32
is_training: True
loader:
Expand Down
7 changes: 3 additions & 4 deletions ppcls/configs/ImageNet/MobileViTv3/MobileViTv3_XXS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Global:
image_shape: [3, 256, 256]
save_inference_dir: ./inference
use_dali: False
update_freq: 3 # for 4 gpus

# mixed precision training
AMP:
Expand Down Expand Up @@ -49,13 +50,11 @@ Optimizer:
epsilon: 1e-8
weight_decay: 0.01
lr:
# for 8 cards
name: Cosine
learning_rate: 0.002
learning_rate: 0.002 # for total batch size 384
eta_min: 0.0002
warmup_epoch: 1 # 3000 iterations
warmup_start_lr: 0.0002
# by_epoch: True

# data loader for train and eval
DataLoader:
Expand Down Expand Up @@ -86,7 +85,7 @@ DataLoader:
scales: [256, 160, 192, 224, 288, 320]
# first_bs: batch size for the first image resolution in the scales list
# divide_factor: to ensure the width and height dimensions can be devided by downsampling multiple
first_bs: 48
first_bs: 32
divided_factor: 32
is_training: True
loader:
Expand Down
7 changes: 3 additions & 4 deletions ppcls/configs/ImageNet/MobileViTv3/MobileViTv3_XXS_L2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Global:
image_shape: [3, 256, 256]
save_inference_dir: ./inference
use_dali: False
update_freq: 3 # for 4 gpus

# mixed precision training
AMP:
Expand Down Expand Up @@ -49,13 +50,11 @@ Optimizer:
epsilon: 1e-8
weight_decay: 0.01
lr:
# for 8 cards
name: Cosine
learning_rate: 0.002
learning_rate: 0.002 # for total batch size 384
eta_min: 0.0002
warmup_epoch: 1 # 3000 iterations
warmup_start_lr: 0.0002
# by_epoch: True

# data loader for train and eval
DataLoader:
Expand Down Expand Up @@ -86,7 +85,7 @@ DataLoader:
scales: [256, 160, 192, 224, 288, 320]
# first_bs: batch size for the first image resolution in the scales list
# divide_factor: to ensure the width and height dimensions can be devided by downsampling multiple
first_bs: 48
first_bs: 32
divided_factor: 32
is_training: True
loader:
Expand Down
7 changes: 3 additions & 4 deletions ppcls/configs/ImageNet/MobileViTv3/MobileViTv3_x0_5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Global:
image_shape: [3, 256, 256]
save_inference_dir: ./inference
use_dali: False
update_freq: 3 # for 4 gpus

# mixed precision training
AMP:
Expand Down Expand Up @@ -50,13 +51,11 @@ Optimizer:
weight_decay: 0.05
one_dim_param_no_weight_decay: True
lr:
# for 8 cards
name: Cosine
learning_rate: 0.002
learning_rate: 0.002 # for total batch size 1020
eta_min: 0.0002
warmup_epoch: 16 # 20000 iterations
warmup_start_lr: 1e-6
# by_epoch: True
clip_norm: 10

# data loader for train and eval
Expand Down Expand Up @@ -104,7 +103,7 @@ DataLoader:
prob: 0.25
sampler:
name: DistributedBatchSampler
batch_size: 128
batch_size: 85
drop_last: False
shuffle: True
loader:
Expand Down
7 changes: 3 additions & 4 deletions ppcls/configs/ImageNet/MobileViTv3/MobileViTv3_x0_75.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Global:
image_shape: [3, 256, 256]
save_inference_dir: ./inference
use_dali: False
update_freq: 3 # for 4 gpus

# mixed precision training
AMP:
Expand Down Expand Up @@ -50,13 +51,11 @@ Optimizer:
weight_decay: 0.05
one_dim_param_no_weight_decay: True
lr:
# for 8 cards
name: Cosine
learning_rate: 0.002
learning_rate: 0.002 # for total batch size 1020
eta_min: 0.0002
warmup_epoch: 16 # 20000 iterations
warmup_start_lr: 1e-6
# by_epoch: True
clip_norm: 10

# data loader for train and eval
Expand Down Expand Up @@ -104,7 +103,7 @@ DataLoader:
prob: 0.25
sampler:
name: DistributedBatchSampler
batch_size: 128
batch_size: 85
drop_last: False
shuffle: True
loader:
Expand Down
7 changes: 3 additions & 4 deletions ppcls/configs/ImageNet/MobileViTv3/MobileViTv3_x1_0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Global:
image_shape: [3, 256, 256]
save_inference_dir: ./inference
use_dali: False
update_freq: 3 # for 4 gpus

# mixed precision training
AMP:
Expand Down Expand Up @@ -50,13 +51,11 @@ Optimizer:
weight_decay: 0.05
one_dim_param_no_weight_decay: True
lr:
# for 8 cards
name: Cosine
learning_rate: 0.002
learning_rate: 0.002 # for total batch size 1020
eta_min: 0.0002
warmup_epoch: 16 # 20000 iterations
warmup_start_lr: 1e-6
# by_epoch: True
clip_norm: 10

# data loader for train and eval
Expand Down Expand Up @@ -104,7 +103,7 @@ DataLoader:
prob: 0.25
sampler:
name: DistributedBatchSampler
batch_size: 128
batch_size: 85
drop_last: False
shuffle: True
loader:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
===========================train_params===========================
model_name:MobileViTv3_S_L2
python:python3.7
gpu_list:0|0,1
-o Global.device:gpu
-o Global.auto_cast:null
-o Global.epochs:lite_train_lite_infer=2|whole_train_whole_infer=120
-o Global.output_dir:./output/
-o DataLoader.Train.sampler.first_bs:8
-o Global.pretrained_model:null
train_model_name:latest
train_infer_img_dir:./dataset/ILSVRC2012/val
null:null
##
trainer:norm_train
norm_train:tools/train.py -c ppcls/configs/ImageNet/MobileViTv3/MobileViTv3_S_L2.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o Global.print_batch_step=1 -o Global.eval_during_train=False -o Global.save_interval=2
pact_train:null
fpgm_train:null
distill_train:null
null:null
null:null
##
===========================eval_params===========================
eval:tools/eval.py -c ppcls/configs/ImageNet/MobileViTv3/MobileViTv3_S_L2.yaml
null:null
##
===========================infer_params==========================
-o Global.save_inference_dir:./inference
-o Global.pretrained_model:
norm_export:tools/export_model.py -c ppcls/configs/ImageNet/MobileViTv3/MobileViTv3_S_L2.yaml
quant_export:null
fpgm_export:null
distill_export:null
kl_quant:null
export2:null
inference_dir:null
infer_model:../inference/
infer_export:True
infer_quant:Fasle
inference:python/predict_cls.py -c configs/inference_cls.yaml -o PreProcess.transform_ops.0.ResizeImage.resize_short=288 -o PreProcess.transform_ops.1.CropImage.size=256 -o PreProcess.transform_ops.2.NormalizeImage.mean=[0.,0.,0.] -o PreProcess.transform_ops.2.NormalizeImage.std=[1.,1.,1.]
-o Global.use_gpu:True|False
-o Global.enable_mkldnn:False
-o Global.cpu_num_threads:1
-o Global.batch_size:1
-o Global.use_tensorrt:False
-o Global.use_fp16:False
-o Global.inference_model_dir:../inference
-o Global.infer_imgs:../dataset/ILSVRC2012/val/ILSVRC2012_val_00000001.JPEG
-o Global.save_log_path:null
-o Global.benchmark:False
null:null
null:null
===========================train_benchmark_params==========================
batch_size:128
fp_items:fp32
epoch:1
model_type:norm_train
--profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile
flags:FLAGS_eager_delete_tensor_gb=0.0;FLAGS_fraction_of_gpu_memory_to_use=0.98;FLAGS_conv_workspace_size_limit=4096
===========================infer_benchmark_params==========================
random_infer_input:[{float32,[3,256,256]}]
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
===========================train_params===========================
model_name:MobileViTv3_XS_L2
python:python3.7
gpu_list:0|0,1
-o Global.device:gpu
-o Global.auto_cast:null
-o Global.epochs:lite_train_lite_infer=2|whole_train_whole_infer=120
-o Global.output_dir:./output/
-o DataLoader.Train.sampler.first_bs:8
-o Global.pretrained_model:null
train_model_name:latest
train_infer_img_dir:./dataset/ILSVRC2012/val
null:null
##
trainer:norm_train
norm_train:tools/train.py -c ppcls/configs/ImageNet/MobileViTv3/MobileViTv3_XS_L2.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o Global.print_batch_step=1 -o Global.eval_during_train=False -o Global.save_interval=2
pact_train:null
fpgm_train:null
distill_train:null
null:null
null:null
##
===========================eval_params===========================
eval:tools/eval.py -c ppcls/configs/ImageNet/MobileViTv3/MobileViTv3_XS_L2.yaml
null:null
##
===========================infer_params==========================
-o Global.save_inference_dir:./inference
-o Global.pretrained_model:
norm_export:tools/export_model.py -c ppcls/configs/ImageNet/MobileViTv3/MobileViTv3_XS_L2.yaml
quant_export:null
fpgm_export:null
distill_export:null
kl_quant:null
export2:null
inference_dir:null
infer_model:../inference/
infer_export:True
infer_quant:Fasle
inference:python/predict_cls.py -c configs/inference_cls.yaml -o PreProcess.transform_ops.0.ResizeImage.resize_short=288 -o PreProcess.transform_ops.1.CropImage.size=256 -o PreProcess.transform_ops.2.NormalizeImage.mean=[0.,0.,0.] -o PreProcess.transform_ops.2.NormalizeImage.std=[1.,1.,1.]
-o Global.use_gpu:True|False
-o Global.enable_mkldnn:False
-o Global.cpu_num_threads:1
-o Global.batch_size:1
-o Global.use_tensorrt:False
-o Global.use_fp16:False
-o Global.inference_model_dir:../inference
-o Global.infer_imgs:../dataset/ILSVRC2012/val/ILSVRC2012_val_00000001.JPEG
-o Global.save_log_path:null
-o Global.benchmark:False
null:null
null:null
===========================train_benchmark_params==========================
batch_size:128
fp_items:fp32
epoch:1
model_type:norm_train
--profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile
flags:FLAGS_eager_delete_tensor_gb=0.0;FLAGS_fraction_of_gpu_memory_to_use=0.98;FLAGS_conv_workspace_size_limit=4096
===========================infer_benchmark_params==========================
random_infer_input:[{float32,[3,256,256]}]
Loading

0 comments on commit a69bc94

Please sign in to comment.