rec_d28_can.yml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. Global:
  2. use_gpu: True
  3. epoch_num: 240
  4. log_smooth_window: 20
  5. print_batch_step: 10
  6. save_model_dir: ./output/rec/can/
  7. save_epoch_step: 1
  8. # evaluation is run every 1105 iterations (1 epoch)(batch_size = 8)
  9. eval_batch_step: [0, 1105]
  10. cal_metric_during_train: True
  11. pretrained_model:
  12. checkpoints:
  13. save_inference_dir:
  14. use_visualdl: False
  15. infer_img: doc/datasets/crohme_demo/hme_00.jpg
  16. # for data or label process
  17. character_dict_path: ppocr/utils/dict/latex_symbol_dict.txt
  18. max_text_length: 36
  19. infer_mode: False
  20. use_space_char: False
  21. save_res_path: ./output/rec/predicts_can.txt
  22. Optimizer:
  23. name: Momentum
  24. momentum: 0.9
  25. clip_norm_global: 100.0
  26. lr:
  27. name: TwoStepCosine
  28. learning_rate: 0.01
  29. warmup_epoch: 1
  30. weight_decay: 0.0001
  31. Architecture:
  32. model_type: rec
  33. algorithm: CAN
  34. in_channels: 1
  35. Transform:
  36. Backbone:
  37. name: DenseNet
  38. growthRate: 24
  39. reduction: 0.5
  40. bottleneck: True
  41. use_dropout: True
  42. input_channel: 1
  43. Head:
  44. name: CANHead
  45. in_channel: 684
  46. out_channel: 111
  47. max_text_length: 36
  48. ratio: 16
  49. attdecoder:
  50. is_train: True
  51. input_size: 256
  52. hidden_size: 256
  53. encoder_out_channel: 684
  54. dropout: True
  55. dropout_ratio: 0.5
  56. word_num: 111
  57. counting_decoder_out_channel: 111
  58. attention:
  59. attention_dim: 512
  60. word_conv_kernel: 1
  61. Loss:
  62. name: CANLoss
  63. PostProcess:
  64. name: CANLabelDecode
  65. Metric:
  66. name: CANMetric
  67. main_indicator: exp_rate
  68. Train:
  69. dataset:
  70. name: SimpleDataSet
  71. data_dir: ./train_data/CROHME/training/images/
  72. label_file_list: ["./train_data/CROHME/training/labels.txt"]
  73. transforms:
  74. - DecodeImage:
  75. channel_first: False
  76. - NormalizeImage:
  77. mean: [0,0,0]
  78. std: [1,1,1]
  79. order: 'hwc'
  80. - GrayImageChannelFormat:
  81. inverse: True
  82. - CANLabelEncode:
  83. lower: False
  84. - KeepKeys:
  85. keep_keys: ['image', 'label']
  86. loader:
  87. shuffle: True
  88. batch_size_per_card: 8
  89. drop_last: False
  90. num_workers: 4
  91. collate_fn: DyMaskCollator
  92. Eval:
  93. dataset:
  94. name: SimpleDataSet
  95. data_dir: ./train_data/CROHME/evaluation/images/
  96. label_file_list: ["./train_data/CROHME/evaluation/labels.txt"]
  97. transforms:
  98. - DecodeImage:
  99. channel_first: False
  100. - NormalizeImage:
  101. mean: [0,0,0]
  102. std: [1,1,1]
  103. order: 'hwc'
  104. - GrayImageChannelFormat:
  105. inverse: True
  106. - CANLabelEncode:
  107. lower: False
  108. - KeepKeys:
  109. keep_keys: ['image', 'label']
  110. loader:
  111. shuffle: False
  112. drop_last: False
  113. batch_size_per_card: 1
  114. num_workers: 4
  115. collate_fn: DyMaskCollator