ResNeXt152_32x4d.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: 120
11 12 13
  print_batch_step: 10
  use_visualdl: False
  # used for static mode and model export
14
  image_shape: [3, 224, 224]
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: ResNeXt152_32x4d
littletomatodonkey's avatar
littletomatodonkey 已提交
32
  class_num: 1000
33 34 35 36 37 38 39 40 41 42 43 44
 
# loss function config for traing/eval process
Loss:
  Train:
    - CELoss:
        weight: 1.0
  Eval:
    - CELoss:
        weight: 1.0


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


# data loader for train and eval
DataLoader:
  Train:
    dataset:
C
cuicheng01 已提交
61 62 63
      name: ImageNetDataset
      image_root: ./dataset/ILSVRC2012/
      cls_label_path: ./dataset/ILSVRC2012/train_list.txt
C
cuicheng01 已提交
64
      transform_ops:
65 66 67
        - DecodeImage:
            to_rgb: True
            channel_first: False
C
cuicheng01 已提交
68
        - RandCropImage:
69
            size: 224
C
cuicheng01 已提交
70 71 72 73 74 75 76
        - 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: ''
77 78

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

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

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

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