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)
https://paddlepaddle.github.io/PaddleOCR/
Apache License 2.0
44.24k stars 7.82k forks source link

paddleocr预训练模型加载问题 #9767

Closed H-eaven-1 closed 1 year ago

H-eaven-1 commented 1 year ago

训练检测模型的过程中,加载MobileNetV3_large_x1_0_pretrained.pdparams模型时出错,显示类似下面的问题 [2023/04/19 14:37:51] ppocr WARNING: The pretrained params conv1.conv.weight not in model [2023/04/19 14:37:51] ppocr WARNING: The pretrained params conv1.bn.weight not in model [2023/04/19 14:37:51] ppocr WARNING: The pretrained params conv1.bn.bias not in model [2023/04/19 14:37:51] ppocr WARNING: The pretrained params conv1.bn._mean not in model [2023/04/19 14:37:51] ppocr WARNING: The pretrained params conv1.bn._variance not in model

配置文件如下: Global: use_gpu: true use_xpu: false use_mlu: false epoch_num: 300 log_smooth_window: 20 print_batch_step: 30 save_model_dir: E:/output/db_mv3 save_epoch_step: 40 eval_batch_step: [0, 500] cal_metric_during_train: False
pretrained_model: E:/pretrain_models/MobileNetV3_large_x1_0_pretrained checkpoints: save_inference_dir: use_visualdl: True infer_img: doc/imgs_en/img_10.jpg save_res_path: ./output/det_db/predicts_db.txt

Architecture: model_type: det algorithm: DB Transform: Backbone: name: MobileNetV3 scale: 1.0 model_name: large Neck: name: DBFPN out_channels: 256 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: learning_rate: 0.001 regularizer: name: 'L2' factor: 0

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: E:/paddleocr_out/train_data/det/ label_file_list:

Eval: dataset: name: SimpleDataSet data_dir: E:/paddleocr_out/train_data/det/ label_file_list:

在backbone部分的选择和预训练模型是对应的,但是为什么会有参数匹配不上的问题呢

raderqi commented 1 year ago

我看他们官方出版的教程里也有这个warning,但是他们是能够正常训练下去的

H-eaven-1 commented 1 year ago

我看他们官方出版的教程里也有这个warning,但是他们是能够正常训练下去的

能训练,但是预训练模型参数加载不进去,模型训练的时间会长一些,效果也不太好

github-actions[bot] commented 1 year ago

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.