Skip to content

Commit

Permalink
volo 0824-d2/d3 config
Browse files Browse the repository at this point in the history
  • Loading branch information
lxg39 committed Aug 24, 2023
1 parent b6f2bba commit cc83238
Show file tree
Hide file tree
Showing 3 changed files with 141 additions and 0 deletions.
8 changes: 8 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,14 @@ def create_parser():
'Choice: O0 - all FP32, O1 - only cast ops in white-list to FP16, '
'O2 - cast all ops except for blacklist to FP16, '
'O3 - cast all ops to FP16. (default="O0").')
group.add_argument('--amp_cast_list', type=str, default=None,
help='At the cell level, customize the black-list or white-list to cast cells to '
'FP16 based on the value of argument "amp_level". If None, use the built-in '
'black-list and white-list. (default=None) '
'If amp_level="O0" or "O3", this argument has no effect. '
'If amp_level="O1", cast all cells in the white-list to FP16. '
'If amp_level="O2", cast all cells except for the black-list to FP16. '
'Example: "[nn.Conv1d, nn.Conv2d]" or "[nn.BatchNorm1d, nn.BatchNorm2d]".')
group.add_argument('--loss_scale_type', type=str, default='fixed',
choices=['fixed', 'dynamic', 'auto'],
help='The type of loss scale (default="fixed")')
Expand Down
66 changes: 66 additions & 0 deletions configs/volo/volo_d2_ascend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# system
mode: 0
distribute: True
num_parallel_workers: 8
val_while_train: True
val_interval: 1

# dataset
dataset: 'imagenet'
data_dir: '/path/to/imagenet'
shuffle: True
dataset_download: False
batch_size: 128
drop_remainder: True

# augmentation
image_resize: 224
scale: [0.08, 1.0]
ratio: [0.75, 1.33]
hflip: 0.5
vflip: 0.
interpolation: 'bicubic'
auto_augment: 'randaug-m9-mstd0.5-inc1'
re_prob: 0.25
mixup: 0.2
cutmix: 1.0
cutmix_prob: 1.0
crop_pct: 0.96
color_jitter: [0.4, 0.4, 0.4]

# model config
model: 'volo_d2'
num_classes: 1000
pretrained: False
ckpt_path: ''
keep_checkpoint_max: 10
ckpt_save_dir: './ckpt/'
ckpt_save_policy: 'top_k'
drop_path_rate: 0.2
dataset_sink_mode: True
amp_level: 'O3'
ema: True
ema_decay: 0.9995

# loss
loss: 'CE'
label_smoothing: 0.1

# lr scheduler
scheduler: 'warmup_cosine_decay'
lr: 0.0007
min_lr: 0.00001
epoch_size: 300
warmup_epochs: 10
decay_epochs: 290
decay_rate: 0.1

# optimizer
opt: 'adamw'
weight_decay: 0.05
momentum: 0.9
filter_bias_and_bn: True
loss_scale_type: 'dynamic'
loss_scale: 2048
use_nesterov: False
drop_overflow_update: True
67 changes: 67 additions & 0 deletions configs/volo/volo_d3_ascend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# system
mode: 0
distribute: True
num_parallel_workers: 8
val_while_train: True
val_interval: 1

# dataset
dataset: 'imagenet'
data_dir: '/path/to/imagenet'
shuffle: True
dataset_download: False
batch_size: 64
drop_remainder: True

# augmentation
image_resize: 224
scale: [0.08, 1.0]
ratio: [0.75, 1.33]
hflip: 0.5
vflip: 0.
interpolation: 'bicubic'
auto_augment: 'randaug-m9-mstd0.5-inc1'
re_prob: 0.25
mixup: 0.2
cutmix: 1.0
cutmix_prob: 1.0
crop_pct: 0.96
color_jitter: [0.4, 0.4, 0.4]

# model
model: 'volo_d3'
num_classes: 1000
pretrained: False
ckpt_path: ''
keep_checkpoint_max: 10
ckpt_save_dir: './ckpt'
ckpt_save_policy: 'top_k'
drop_path_rate: 0.5
dataset_sink_mode: True
amp_level: 'O3'
ema: True
ema_decay: 0.9995
gradient_accumulation_steps: 2

# loss
loss: 'CE'
label_smoothing: 0.1

# lr scheduler
scheduler: 'warmup_cosine_decay'
lr: 0.0005
min_lr: 0.00001
epoch_size: 3
warmup_epochs: 10
decay_epochs: 290
decay_rate: 0.1

# optimizer
opt: 'adamw'
weight_decay: 0.05
momentum: 0.9
filter_bias_and_bn: True
loss_scale_type: 'dynamic'
loss_scale: 1024
use_nesterov: False
drop_overflow_update: True

0 comments on commit cc83238

Please sign in to comment.