cls_mv3.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. Global:
  2. use_gpu: true
  3. epoch_num: 100
  4. log_smooth_window: 20
  5. print_batch_step: 10
  6. save_model_dir: ./output/cls/mv3/
  7. save_epoch_step: 3
  8. # evaluation is run every 5000 iterations after the 4000th iteration
  9. eval_batch_step: [0, 1000]
  10. # if pretrained_model is saved in static mode, load_static_weights must set to True
  11. cal_metric_during_train: True
  12. pretrained_model:
  13. checkpoints:
  14. save_inference_dir:
  15. use_visualdl: False
  16. infer_img: doc/imgs_words_en/word_10.png
  17. label_list: ['0','180']
  18. Architecture:
  19. model_type: cls
  20. algorithm: CLS
  21. Transform:
  22. Backbone:
  23. name: MobileNetV3
  24. scale: 0.35
  25. model_name: small
  26. Neck:
  27. Head:
  28. name: ClsHead
  29. class_dim: 2
  30. Loss:
  31. name: ClsLoss
  32. Optimizer:
  33. name: Adam
  34. beta1: 0.9
  35. beta2: 0.999
  36. lr:
  37. name: Cosine
  38. learning_rate: 0.001
  39. regularizer:
  40. name: 'L2'
  41. factor: 0
  42. PostProcess:
  43. name: ClsPostProcess
  44. Metric:
  45. name: ClsMetric
  46. main_indicator: acc
  47. Train:
  48. dataset:
  49. name: SimpleDataSet
  50. data_dir: ./train_data/cls
  51. label_file_list:
  52. - ./train_data/cls/train.txt
  53. transforms:
  54. - DecodeImage: # load image
  55. img_mode: BGR
  56. channel_first: False
  57. - ClsLabelEncode: # Class handling label
  58. - RecAug:
  59. use_tia: False
  60. - RandAugment:
  61. - ClsResizeImg:
  62. image_shape: [3, 48, 192]
  63. - KeepKeys:
  64. keep_keys: ['image', 'label'] # dataloader will return list in this order
  65. loader:
  66. shuffle: True
  67. batch_size_per_card: 512
  68. drop_last: True
  69. num_workers: 8
  70. Eval:
  71. dataset:
  72. name: SimpleDataSet
  73. data_dir: ./train_data/cls
  74. label_file_list:
  75. - ./train_data/cls/test.txt
  76. transforms:
  77. - DecodeImage: # load image
  78. img_mode: BGR
  79. channel_first: False
  80. - ClsLabelEncode: # Class handling label
  81. - ClsResizeImg:
  82. image_shape: [3, 48, 192]
  83. - KeepKeys:
  84. keep_keys: ['image', 'label'] # dataloader will return list in this order
  85. loader:
  86. shuffle: False
  87. drop_last: False
  88. batch_size_per_card: 512
  89. num_workers: 4