PaddlePaddle / PaddleOCR

Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)
Apache License 2.0
39.34k stars 7.35k forks source link

微调训练ch_PP-OCRv3_det_distill_train的student模型,无论如何训练改参数,eval的准确率不超过50%,而且曾经能预测也无法预测 #10370

Closed zxy2020 closed 2 weeks ago

zxy2020 commented 10 months ago

数据集大小:1600(train)+ 500 (val) 数据集制作方式: 使用paddleocr 推理后选出没有问题导入,有问题的重新标记,但是训练后原来能检测也不能检测了 数据集内容: image GPU: Teslav100 *4 32G (aistudio),单卡也训过,(单卡8batch lr 0.0001, 4卡 0.0005) 配置文件:configs/det/ch_PP-OCRv3/ch_PP-OCRv3_det_student.yml

开始训练前指标: image 训练后的指标: image

Global: debug: false use_gpu: true epoch_num: 200 log_smooth_window: 20 print_batch_step: 10 save_model_dir: ./output/0712_ch_PP-OCR_V3_det/ save_epoch_step: 100 eval_batch_step:

  • 0
  • 50 cal_metric_during_train: false pretrained_model: /home/aistudio/PaddleOCR/ch_PP-OCRv3_det_distill_train/student.pdparams checkpoints: /home/aistudio/PaddleOCR/output/0712_ch_PP-OCR_V3_det/latest.pdparams save_inference_dir: null use_visualdl: false infer_img: doc/imgs_en/img_10.jpg save_res_path: ./checkpoints/det_db/predicts_db.txt distributed: true

Architecture: model_type: det algorithm: DB Transform: Backbone: name: MobileNetV3 scale: 0.5 model_name: large disable_se: True Neck: name: RSEFPN out_channels: 96 shortcut: True Head: name: DBHead k: 50

Loss: name: DBLoss balance_loss: true main_loss_type: DiceLoss alpha: 5 beta: 10 ohem_ratio: 3 Optimizer: name: Adam beta1: 0.9 beta2: 0.999 lr: name: Cosine learning_rate: 0.0005 # 0.001 warmup_epoch: 2 regularizer: name: L2 factor: 5.0e-05 PostProcess: name: DBPostProcess thresh: 0.3 box_thresh: 0.6 max_candidates: 1000 unclip_ratio: 2 Metric: name: DetMetric main_indicator: hmean Train: dataset: name: SimpleDataSet data_dir: /home/aistudio/art_det_good_2800/train label_file_list:

izhaolinger commented 10 months ago

是否是epoch少了?

zxy2020 commented 10 months ago

是否是epoch少了? 那我再试一试原始的轮速 你好,我只有2000张图片微调的,大概100epoch。 数据量和epoch的轮数有关系吗?

izhaolinger commented 10 months ago

是否是epoch少了? 那我再试一试原始的轮速 你好,我只有2000张图片微调的,大概100epoch。 数据量和epoch的轮数有关系吗?

我和你一样,用的ch_PP-OCRv3_det_distill_train的student做微调,数据量上和你也差不多,1000个epoch,hmean:0.75,看到了一些效果

zxy2020 commented 10 months ago

我和你一样,用的ch_PP-OCRv3_det_distill_train的student做微调,数据量上和你也差不多,1000个epoch,hmean:0.75,看到了一些效果 请问可以看下你的训练的配置文件吗? 是否还修改了其他参数,GPU数,学习率调节,因为我的数据单一,我把数据增强都关了

izhaolinger commented 10 months ago

我和你一样,用的ch_PP-OCRv3_det_distill_train的student做微调,数据量上和你也差不多,1000个epoch,hmean:0.75,看到了一些效果 请问可以看下你的训练的配置文件吗? 是否还修改了其他参数,GPU数,学习率调节,因为我的数据单一,我把数据增强都关了

可以的,这是我的配置文件:

Global: debug: false use_gpu: true epoch_num: 1000 log_smooth_window: 20 print_batch_step: 10 save_model_dir: ./output/ch_PP-OCR_V3_det/ save_epoch_step: 100 eval_batch_step:

Architecture: model_type: det algorithm: DB Transform: Backbone: name: MobileNetV3 scale: 0.5 model_name: large disable_se: True Neck: name: RSEFPN out_channels: 96 shortcut: True Head: name: DBHead k: 50

Loss: name: DBLoss balance_loss: true main_loss_type: DiceLoss alpha: 5 beta: 10 ohem_ratio: 3 Optimizer: name: Adam beta1: 0.9 beta2: 0.999 lr: name: Cosine learning_rate: 0.0001 warmup_epoch: 2 regularizer: name: L2 factor: 5.0e-05 PostProcess: name: DBPostProcess thresh: 0.3 box_thresh: 0.6 max_candidates: 1000 unclip_ratio: 1.5 Metric: name: DetMetric main_indicator: hmean Train: dataset: name: SimpleDataSet data_dir: /data/project/PaddleOCR-release-2.6/train_data/ label_file_list: [ '/data/project/PaddleOCR-release-2.6/train_data/1/det/train.txt', '/data/project/PaddleOCR-release-2.6/train_data/2/det/train.txt', '/data/project/PaddleOCR-release-2.6/train_data/3/det/train.txt' ] ratio_list: [ 1.0, 1.0, 1.0 ] transforms:

GPU的话,我用两个两张GPU。

UserWangZz commented 2 weeks ago

该issue长时间未更新,暂将此issue关闭,如有需要可重新开启。