ResNet50.yaml 2.9 KB
Newer Older
L
littletomatodonkey 已提交
1 2
# global configs
Global:
C
cuicheng01 已提交
3
  checkpoints: null
4
  pretrained_model: null
C
cuicheng01 已提交
5 6
  output_dir: ./output/
  device: gpu
L
littletomatodonkey 已提交
7 8 9
  save_interval: 1
  eval_during_train: True
  eval_interval: 1
10
  epochs: 120
L
littletomatodonkey 已提交
11 12
  print_batch_step: 10
  use_visualdl: False
13
  # used for static mode and model export
L
littletomatodonkey 已提交
14
  image_shape: [3, 224, 224]
C
cuicheng01 已提交
15
  save_inference_dir: ./inference
A
Aurelius84 已提交
16 17
  # training model under @to_static
  to_static: False
L
littletomatodonkey 已提交
18

G
gaotingquan 已提交
19 20 21 22 23 24 25 26 27 28 29 30

# 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


L
littletomatodonkey 已提交
31 32
# model architecture
Arch:
C
cuicheng01 已提交
33
  name: ResNet50
littletomatodonkey's avatar
littletomatodonkey 已提交
34
  class_num: 1000
B
Bin Lu 已提交
35
 
L
littletomatodonkey 已提交
36 37 38 39 40 41 42 43 44 45 46
# loss function config for traing/eval process
Loss:
  Train:
    - CELoss:
        weight: 1.0
  Eval:
    - CELoss:
        weight: 1.0


Optimizer:
C
cuicheng01 已提交
47
  name: Momentum
L
littletomatodonkey 已提交
48 49
  momentum: 0.9
  lr:
C
cuicheng01 已提交
50
    name: Piecewise
L
littletomatodonkey 已提交
51 52 53 54 55 56 57 58 59 60 61
    learning_rate: 0.1
    decay_epochs: [30, 60, 90]
    values: [0.1, 0.01, 0.001, 0.0001]
  regularizer:
    name: 'L2'
    coeff: 0.0001


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

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

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

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

L
littletomatodonkey 已提交
138
Metric:
C
cuicheng01 已提交
139
  Train:
L
littletomatodonkey 已提交
140 141
    - TopkAcc:
        topk: [1, 5]
C
cuicheng01 已提交
142
  Eval:
L
littletomatodonkey 已提交
143 144
    - TopkAcc:
        topk: [1, 5]