ResNeSt101.yaml 2.9 KB
Newer Older
1 2 3 4
# global configs
Global:
  checkpoints: null
  pretrained_model: null
C
cuicheng01 已提交
5 6
  output_dir: ./output/
  device: gpu
7 8 9
  save_interval: 1
  eval_during_train: True
  eval_interval: 1
10
  epochs: 300
11 12 13
  print_batch_step: 10
  use_visualdl: False
  # used for static mode and model export
C
cuicheng01 已提交
14
  image_shape: [3, 256, 256]
C
cuicheng01 已提交
15
  save_inference_dir: ./inference
16

G
gaotingquan 已提交
17 18 19 20 21 22 23 24 25 26 27 28

# mixed precision
AMP:
  use_amp: False
  use_fp16_test: False
  scale_loss: 128.0
  use_dynamic_loss_scaling: True
  use_promote: False
  # O1: mixed fp16, O2: pure fp16
  level: O1


29 30
# model architecture
Arch:
31
  name: ResNeSt101
littletomatodonkey's avatar
littletomatodonkey 已提交
32
  class_num: 1000
33 34 35 36
 
# loss function config for traing/eval process
Loss:
  Train:
G
gaotingquan 已提交
37
    - CELoss:
38
        weight: 1.0
C
cuicheng01 已提交
39
        epsilon: 0.1
40 41 42 43 44 45
  Eval:
    - CELoss:
        weight: 1.0


Optimizer:
C
cuicheng01 已提交
46
  name: Momentum
47 48
  momentum: 0.9
  lr:
C
cuicheng01 已提交
49
    name: Cosine
50
    learning_rate: 0.1
51 52
  regularizer:
    name: 'L2'
weixin_46524038's avatar
weixin_46524038 已提交
53
    coeff: 0.0001
54 55 56 57 58 59


# data loader for train and eval
DataLoader:
  Train:
    dataset:
C
cuicheng01 已提交
60 61 62
      name: ImageNetDataset
      image_root: ./dataset/ILSVRC2012/
      cls_label_path: ./dataset/ILSVRC2012/train_list.txt
C
cuicheng01 已提交
63
      transform_ops:
64 65 66
        - DecodeImage:
            to_rgb: True
            channel_first: False
C
cuicheng01 已提交
67
        - RandCropImage:
C
cuicheng01 已提交
68
            size: 256
C
cuicheng01 已提交
69 70
        - RandFlipImage:
            flip_code: 1
71
        - AutoAugment:
C
cuicheng01 已提交
72 73 74 75 76
        - NormalizeImage:
            scale: 1.0/255.0
            mean: [0.485, 0.456, 0.406]
            std: [0.229, 0.224, 0.225]
            order: ''
77 78 79
      batch_transform_ops:
        - MixupOperator:
            alpha: 0.2
80 81

    sampler:
C
cuicheng01 已提交
82
      name: DistributedBatchSampler
C
cuicheng01 已提交
83 84 85
      batch_size: 64
      drop_last: False
      shuffle: True
86
    loader:
C
cuicheng01 已提交
87 88
      num_workers: 4
      use_shared_memory: True
89 90 91

  Eval:
    dataset: 
C
cuicheng01 已提交
92 93 94
      name: ImageNetDataset
      image_root: ./dataset/ILSVRC2012/
      cls_label_path: ./dataset/ILSVRC2012/val_list.txt
C
cuicheng01 已提交
95
      transform_ops:
96 97 98
        - DecodeImage:
            to_rgb: True
            channel_first: False
C
cuicheng01 已提交
99
        - ResizeImage:
C
cuicheng01 已提交
100
            resize_short: 288
C
cuicheng01 已提交
101
        - CropImage:
C
cuicheng01 已提交
102
            size: 256
C
cuicheng01 已提交
103 104 105 106 107
        - NormalizeImage:
            scale: 1.0/255.0
            mean: [0.485, 0.456, 0.406]
            std: [0.229, 0.224, 0.225]
            order: ''
108
    sampler:
C
cuicheng01 已提交
109
      name: DistributedBatchSampler
weixin_46524038's avatar
weixin_46524038 已提交
110
      batch_size: 128
C
cuicheng01 已提交
111 112
      drop_last: False
      shuffle: False
113
    loader:
C
cuicheng01 已提交
114 115
      num_workers: 4
      use_shared_memory: True
116 117

Infer:
T
Tingquan Gao 已提交
118
  infer_imgs: docs/images/inference_deployment/whl_demo.jpg
119 120
  batch_size: 10
  transforms:
C
cuicheng01 已提交
121 122 123 124
    - DecodeImage:
        to_rgb: True
        channel_first: False
    - ResizeImage:
C
cuicheng01 已提交
125
        resize_short: 288
C
cuicheng01 已提交
126
    - CropImage:
C
cuicheng01 已提交
127
        size: 256
C
cuicheng01 已提交
128 129 130 131 132 133
    - NormalizeImage:
        scale: 1.0/255.0
        mean: [0.485, 0.456, 0.406]
        std: [0.229, 0.224, 0.225]
        order: ''
    - ToCHWImage:
134
  PostProcess:
C
cuicheng01 已提交
135
    name: Topk
136
    topk: 5
C
cuicheng01 已提交
137
    class_id_map_file: ppcls/utils/imagenet1k_label_list.txt
138 139

Metric:
C
cuicheng01 已提交
140 141
  Train:
  Eval:
C
cuicheng01 已提交
142
    - TopkAcc:
weixin_46524038's avatar
weixin_46524038 已提交
143
        topk: [1, 5]