Closed 1wang11lijian1 closed 1 year ago
python tools/train.py -c configs/det/ch_PP-OCRv3/ch_PP-OCRv3_det_cml.yml -o Global.checkpoints=./pretrain_models/en_PP-OCRv3_det_distill_train/ 这样试试
@LDOUBLEV 好兄弟这样改完真的有效果了,非常感谢!但是我有个问题因为本身导入的模型效果就已经很好了,我这边自己训练的究竟提升了多少的效果,有没有可能丝毫没有提升呢?再就是之前导入预训练的模型一直训练不出结果是不是也有可能是这个原因。
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem
下面是文字检测的训练代码 训练的代码(加载了PP-OCRv3检测模型的权重) python tools/train.py -c configs/det/ch_PP-OCRv3/ch_PP-OCRv3_det_cml.yml -o Global.pretrain_weights=./pretrain_models/en_PP-OCRv3_det_distill_train/
以下是训练的ch_PP-OCRv3_det_cml.yml文件 Global: debug: false use_gpu: true epoch_num: 500 log_smooth_window: 20 print_batch_step: 10 save_model_dir: ./output/en_PP-OCR_v3_det/ save_epoch_step: 100 eval_batch_step: 0 400 cal_metric_during_train: false pretrained_model: null checkpoints: null save_inference_dir: null use_visualdl: false infer_img: null save_res_path: ./output/det/predicts_ppocrv3_en.txt distributed: true Architecture: name: DistillationModel algorithm: Distillation model_type: det Models: Student: pretrained: model_type: det algorithm: DB Transform: null 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 Student2: pretrained: model_type: det algorithm: DB Transform: null 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 Teacher: pretrained: freeze_params: true return_all_feats: false model_type: det algorithm: DB Backbone: name: ResNet_vd in_channels: 3 layers: 50 Neck: name: LKPAN out_channels: 256 Head: name: DBHead kernel_list: [7,2,2] k: 50
Loss: name: CombinedLoss loss_config_list:
DistillationDilaDBLoss: weight: 1.0 model_name_pairs: ["Student", "Teacher"] ["Student2", "Teacher"] key: maps balance_loss: true main_loss_type: DiceLoss alpha: 5 beta: 10 ohem_ratio: 3 DistillationDMLLoss: model_name_pairs: ["Student", "Student2"] maps_name: "thrink_maps" weight: 1.0 model_name_pairs: ["Student", "Student2"] key: maps DistillationDBLoss: weight: 1.0 model_name_list: ["Student", "Student2"] 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.001 warmup_epoch: 2 regularizer: name: L2 factor: 5.0e-05
PostProcess: name: DistillationDBPostProcess model_name: ["Student"] key: head_out thresh: 0.3 box_thresh: 0.6 max_candidates: 1000 unclip_ratio: 1.5
Metric: name: DistillationMetric base_metric_name: DetMetric main_indicator: hmean key: "Student"
Train: dataset: name: SimpleDataSet data_dir: ./train_data/icdar2015/text_localization/icdar_c4_train_imgs/ label_file_list: