当前位置:   article > 正文

PaddleOcr安装和训练备忘录_sampler: name: multiscalesampler

sampler: name: multiscalesampler

目录

如果你要安装PaddleHub,不要使用python 3.12

设置系统变量:HUB_HOME,修改PaddleHub模型目录

Could not locate zlibwapi.dll问题

模型训练主要参数说明:

加入自动混合精度训练提高训练速度


如果你要安装PaddleHub,不要使用python 3.12

用到了sentencepiece 0.1.99版本,3.12版本py无法编译成功
可以使用 pip install sentencepiece==0.1.99 测试是否可以安装

设置系统变量:HUB_HOME,修改PaddleHub模型目录

Could not locate zlibwapi.dll问题

缺少zlibwapi.dll,网上都说去nvidia下载,里面内容已经更新了,找不到下载的地方了

模型训练主要参数说明:

epoch_num: 总的训练轮数

print_batch_step: 每隔多少个batch打印一回信息

save_model_dir: 模型保存路径

save_epoch_step: 模型保存时间间隔,以epoch计

eval_batch_step: 在第0个batch后每隔500个batch评估一次

batch_size_per_card: 每个batch运行的图片数,过多会爆显存

pretrained_model: 预训练模型(F:\paddle_train\output\verify\tran\en_PP-OCRv4_rec_train\best_accuracy)

character_dict_path:字典(F:\paddle_train\output\verify\data\new_dict.txt)

加入自动混合精度训练提高训练速度

  use_amp: True 
  scale_loss: 1024.0
  use_dynamic_loss_scaling: True
  use_gpu: true

  1. Global:
  2. debug: false
  3. use_amp: True
  4. scale_loss: 1024.0
  5. use_dynamic_loss_scaling: True
  6. use_gpu: true
  7. epoch_num: 50
  8. log_smooth_window: 20
  9. print_batch_step: 10
  10. save_model_dir: F:\paddle_train\output\verify\output\rec_verify_v4
  11. save_epoch_step: 3
  12. eval_batch_step:
  13. - 0
  14. - 500
  15. cal_metric_during_train: true
  16. pretrained_model: F:\paddle_train\output\verify\tran\en_PP-OCRv4_rec_train\best_accuracy
  17. checkpoints: null
  18. save_inference_dir: F:\paddle_train\output\verify\output\inference
  19. use_visualdl: false
  20. infer_img: doc\imgs_words\ch\word_1.jpg
  21. character_dict_path: F:\paddle_train\output\verify\data\new_dict.txt
  22. max_text_length: 6
  23. infer_mode: false
  24. use_space_char: false
  25. distributed: true
  26. save_res_path: F:\paddle_train\output\verify\output\rec\predicts_ppocrv3.txt
  27. Optimizer:
  28. name: Adam
  29. beta1: 0.9
  30. beta2: 0.999
  31. lr:
  32. name: Cosine
  33. learning_rate: 0.0005
  34. warmup_epoch: 5
  35. regularizer:
  36. name: L2
  37. factor: 3.0e-05
  38. Architecture:
  39. model_type: rec
  40. algorithm: SVTR_LCNet
  41. Transform: null
  42. Backbone:
  43. name: PPLCNetV3
  44. scale: 0.95
  45. Head:
  46. name: MultiHead
  47. head_list:
  48. - CTCHead:
  49. Neck:
  50. name: svtr
  51. dims: 120
  52. depth: 2
  53. hidden_dims: 120
  54. kernel_size:
  55. - 1
  56. - 3
  57. use_guide: true
  58. Head:
  59. fc_decay: 1.0e-05
  60. - NRTRHead:
  61. nrtr_dim: 384
  62. max_text_length: 6
  63. Loss:
  64. name: MultiLoss
  65. loss_config_list:
  66. - CTCLoss: null
  67. - NRTRLoss: null
  68. PostProcess:
  69. name: CTCLabelDecode
  70. Metric:
  71. name: RecMetric
  72. main_indicator: acc
  73. ignore_space: false
  74. Train:
  75. dataset:
  76. name: MultiScaleDataSet
  77. ds_width: false
  78. data_dir: F:\paddle_train\output\verify\data\verification_code
  79. ext_op_transform_idx: 1
  80. label_file_list:
  81. - F:\paddle_train\output\verify\data\train_list.txt
  82. transforms:
  83. - DecodeImage:
  84. img_mode: BGR
  85. channel_first: false
  86. - RecConAug:
  87. prob: 0.5
  88. ext_data_num: 2
  89. image_shape:
  90. - 48
  91. - 320
  92. - 3
  93. max_text_length: 6
  94. - RecAug: null
  95. - MultiLabelEncode:
  96. gtc_encode: NRTRLabelEncode
  97. - KeepKeys:
  98. keep_keys:
  99. - image
  100. - label_ctc
  101. - label_gtc
  102. - length
  103. - valid_ratio
  104. sampler:
  105. name: MultiScaleSampler
  106. scales:
  107. - - 320
  108. - 32
  109. - - 320
  110. - 48
  111. - - 320
  112. - 64
  113. first_bs: 96
  114. fix_bs: false
  115. divided_factor:
  116. - 8
  117. - 16
  118. is_training: true
  119. loader:
  120. shuffle: true
  121. batch_size_per_card: 65
  122. drop_last: true
  123. num_workers: 4
  124. Eval:
  125. dataset:
  126. name: SimpleDataSet
  127. data_dir: F:\paddle_train\output\verify\data\verification_code
  128. label_file_list:
  129. - F:\paddle_train\output\verify\data\test_list.txt
  130. transforms:
  131. - DecodeImage:
  132. img_mode: BGR
  133. channel_first: false
  134. - MultiLabelEncode:
  135. gtc_encode: NRTRLabelEncode
  136. - RecResizeImg:
  137. image_shape:
  138. - 3
  139. - 48
  140. - 320
  141. - KeepKeys:
  142. keep_keys:
  143. - image
  144. - label_ctc
  145. - label_gtc
  146. - length
  147. - valid_ratio
  148. loader:
  149. shuffle: false
  150. drop_last: false
  151. batch_size_per_card: 32
  152. num_workers: 4
  153. profiler_options: null

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/670385
推荐阅读
相关标签
  

闽ICP备14008679号