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.1k stars 7.81k forks source link

PaddleOCR-release-2.1 文本检测训练,按照Github教程操作 命令行运行,output文件夹下没有模型 #3190

Closed chenyuqiang234 closed 3 years ago

chenyuqiang234 commented 3 years ago

****一下为PaddleOCR-release-2.1\configs\det\det_mv3_db.yml****基本上没动什么地方 Global: use_gpu: true epoch_num: 1200 log_smooth_window: 20 print_batch_step: 10 save_model_dir: ./output/db_mv3/ save_epoch_step: 100

evaluation is run every 2000 iterations

eval_batch_step: [0, 2000] cal_metric_during_train: false pretrained_model: ./pretrain_models/MobileNetV3_large_x0_5_pretrained checkpoints: save_inference_dir: use_visualdl: false 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: 0.5 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: ./train_data/icdar2015/text_localization/ label_file_list:

Eval: dataset: name: SimpleDataSet data_dir: ./train_data/icdar2015/text_localization/ label_file_list:

*运行脚本 python tools/train.py -c configs/det/det_mv3_db.yml -o Global.pretrain_weights=./pretrain_models/back_MobileNetV3_large_x0_5_pretrained/

***output下只有这些文件,不见保存的模型 image

**运行控制台打印的的log*** (venv) D:\Pythonwork\ocr-project\PaddleOCR>python tools/train.py -c configs/det/det_mv3_db.yml -o Global.pretrain_weights=./pretrain_models/back_MobileNetV3_large_x0_5_pretrained/ D:\Pythonwork\ocr-project\venv\lib\distutils__init__.py:1: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses import imp [2021/06/25 14:07:43] root INFO: Architecture : [2021/06/25 14:07:43] root INFO: Backbone : [2021/06/25 14:07:43] root INFO: model_name : large [2021/06/25 14:07:43] root INFO: name : MobileNetV3 [2021/06/25 14:07:43] root INFO: scale : 0.5 [2021/06/25 14:07:43] root INFO: Head : [2021/06/25 14:07:43] root INFO: k : 50 [2021/06/25 14:07:43] root INFO: name : DBHead [2021/06/25 14:07:43] root INFO: Neck : [2021/06/25 14:07:43] root INFO: name : DBFPN [2021/06/25 14:07:43] root INFO: out_channels : 256 [2021/06/25 14:07:43] root INFO: Transform : None [2021/06/25 14:07:43] root INFO: algorithm : DB [2021/06/25 14:07:43] root INFO: model_type : det [2021/06/25 14:07:43] root INFO: Eval : [2021/06/25 14:07:43] root INFO: dataset : [2021/06/25 14:07:43] root INFO: data_dir : ./train_data/icdar2015/text_localization/ [2021/06/25 14:07:43] root INFO: label_file_list : ['./train_data/icdar2015/text_localization/test_icdar2015_label.txt'] [2021/06/25 14:07:43] root INFO: name : SimpleDataSet [2021/06/25 14:07:43] root INFO: transforms : [2021/06/25 14:07:43] root INFO: DecodeImage : [2021/06/25 14:07:43] root INFO: channel_first : False [2021/06/25 14:07:43] root INFO: img_mode : BGR [2021/06/25 14:07:43] root INFO: DetLabelEncode : None [2021/06/25 14:07:43] root INFO: DetResizeForTest : [2021/06/25 14:07:43] root INFO: image_shape : [736, 1280] [2021/06/25 14:07:43] root INFO: NormalizeImage : [2021/06/25 14:07:43] root INFO: mean : [0.485, 0.456, 0.406] [2021/06/25 14:07:43] root INFO: order : hwc [2021/06/25 14:07:43] root INFO: scale : 1./255. [2021/06/25 14:07:43] root INFO: std : [0.229, 0.224, 0.225] [2021/06/25 14:07:43] root INFO: ToCHWImage : None [2021/06/25 14:07:43] root INFO: KeepKeys : [2021/06/25 14:07:43] root INFO: keep_keys : ['image', 'shape', 'polys', 'ignore_tags'] [2021/06/25 14:07:43] root INFO: loader : [2021/06/25 14:07:43] root INFO: batch_size_per_card : 1 [2021/06/25 14:07:43] root INFO: drop_last : False [2021/06/25 14:07:43] root INFO: num_workers : 8 [2021/06/25 14:07:43] root INFO: shuffle : False [2021/06/25 14:07:43] root INFO: use_shared_memory : False [2021/06/25 14:07:43] root INFO: Global : [2021/06/25 14:07:43] root INFO: cal_metric_during_train : True [2021/06/25 14:07:43] root INFO: checkpoints : None [2021/06/25 14:07:43] root INFO: debug : False [2021/06/25 14:07:43] root INFO: distributed : False [2021/06/25 14:07:43] root INFO: epoch_num : 1200 [2021/06/25 14:07:43] root INFO: eval_batch_step : [0, 2000] [2021/06/25 14:07:43] root INFO: infer_img : doc/imgs_en/img_10.jpg [2021/06/25 14:07:43] root INFO: log_smooth_window : 20 [2021/06/25 14:07:43] root INFO: pretrain_weights : ./pretrain_models/back_MobileNetV3_large_x0_5_pretrained/ [2021/06/25 14:07:43] root INFO: pretrained_model : ./pretrain_models/MobileNetV3_large_x0_5_pretrained [2021/06/25 14:07:43] root INFO: print_batch_step : 10 [2021/06/25 14:07:43] root INFO: save_epoch_step : 100 [2021/06/25 14:07:43] root INFO: save_inference_dir : None [2021/06/25 14:07:43] root INFO: save_model_dir : ./output/db_mv3/ [2021/06/25 14:07:43] root INFO: save_res_path : ./output/det_db/predicts_db.txt [2021/06/25 14:07:43] root INFO: use_gpu : True [2021/06/25 14:07:43] root INFO: use_visualdl : False [2021/06/25 14:07:43] root INFO: Loss : [2021/06/25 14:07:43] root INFO: alpha : 5 [2021/06/25 14:07:43] root INFO: balance_loss : True [2021/06/25 14:07:43] root INFO: beta : 10 [2021/06/25 14:07:43] root INFO: main_loss_type : DiceLoss [2021/06/25 14:07:43] root INFO: name : DBLoss [2021/06/25 14:07:43] root INFO: ohem_ratio : 3 [2021/06/25 14:07:43] root INFO: Metric : [2021/06/25 14:07:43] root INFO: main_indicator : hmean [2021/06/25 14:07:43] root INFO: name : DetMetric [2021/06/25 14:07:43] root INFO: Optimizer : [2021/06/25 14:07:43] root INFO: beta1 : 0.9 [2021/06/25 14:07:43] root INFO: beta2 : 0.999 [2021/06/25 14:07:43] root INFO: lr : [2021/06/25 14:07:43] root INFO: learning_rate : 0.001 [2021/06/25 14:07:43] root INFO: name : Adam [2021/06/25 14:07:43] root INFO: regularizer : [2021/06/25 14:07:43] root INFO: factor : 0 [2021/06/25 14:07:43] root INFO: name : L2 [2021/06/25 14:07:43] root INFO: PostProcess : [2021/06/25 14:07:43] root INFO: box_thresh : 0.6 [2021/06/25 14:07:43] root INFO: max_candidates : 1000 [2021/06/25 14:07:43] root INFO: name : DBPostProcess [2021/06/25 14:07:43] root INFO: thresh : 0.3 [2021/06/25 14:07:43] root INFO: unclip_ratio : 1.5 [2021/06/25 14:07:43] root INFO: Train : [2021/06/25 14:07:43] root INFO: dataset : [2021/06/25 14:07:43] root INFO: data_dir : ./train_data/icdar2015/text_localization/ [2021/06/25 14:07:43] root INFO: label_file_list : ['./train_data/icdar2015/text_localization/train_icdar2015_label.txt'] [2021/06/25 14:07:43] root INFO: name : SimpleDataSet [2021/06/25 14:07:43] root INFO: ratio_list : [1.0] [2021/06/25 14:07:43] root INFO: transforms : [2021/06/25 14:07:43] root INFO: DecodeImage : [2021/06/25 14:07:43] root INFO: channel_first : False [2021/06/25 14:07:43] root INFO: img_mode : BGR [2021/06/25 14:07:43] root INFO: DetLabelEncode : None [2021/06/25 14:07:43] root INFO: IaaAugment : [2021/06/25 14:07:43] root INFO: augmenter_args : [2021/06/25 14:07:43] root INFO: args : [2021/06/25 14:07:43] root INFO: p : 0.5 [2021/06/25 14:07:43] root INFO: type : Fliplr [2021/06/25 14:07:43] root INFO: args : [2021/06/25 14:07:43] root INFO: rotate : [-10, 10] [2021/06/25 14:07:43] root INFO: type : Affine [2021/06/25 14:07:43] root INFO: args : [2021/06/25 14:07:43] root INFO: size : [0.5, 3] [2021/06/25 14:07:43] root INFO: type : Resize [2021/06/25 14:07:43] root INFO: EastRandomCropData : [2021/06/25 14:07:43] root INFO: keep_ratio : True [2021/06/25 14:07:43] root INFO: max_tries : 50 [2021/06/25 14:07:43] root INFO: size : [640, 640] [2021/06/25 14:07:43] root INFO: MakeBorderMap : [2021/06/25 14:07:43] root INFO: shrink_ratio : 0.4 [2021/06/25 14:07:43] root INFO: thresh_max : 0.7 [2021/06/25 14:07:43] root INFO: thresh_min : 0.3 [2021/06/25 14:07:43] root INFO: MakeShrinkMap : [2021/06/25 14:07:43] root INFO: min_text_size : 8 [2021/06/25 14:07:43] root INFO: shrink_ratio : 0.4 [2021/06/25 14:07:43] root INFO: NormalizeImage : [2021/06/25 14:07:43] root INFO: mean : [0.485, 0.456, 0.406] [2021/06/25 14:07:43] root INFO: order : hwc [2021/06/25 14:07:43] root INFO: scale : 1./255. [2021/06/25 14:07:43] root INFO: std : [0.229, 0.224, 0.225] [2021/06/25 14:07:43] root INFO: ToCHWImage : None [2021/06/25 14:07:43] root INFO: KeepKeys : [2021/06/25 14:07:43] root INFO: keep_keys : ['image', 'threshold_map', 'threshold_mask', 'shrink_map', 'shrink_mask'] [2021/06/25 14:07:43] root INFO: loader : [2021/06/25 14:07:43] root INFO: batch_size_per_card : 16 [2021/06/25 14:07:43] root INFO: drop_last : False [2021/06/25 14:07:43] root INFO: num_workers : 8 [2021/06/25 14:07:43] root INFO: shuffle : True [2021/06/25 14:07:43] root INFO: use_shared_memory : False [2021/06/25 14:07:43] root INFO: train with paddle 2.1.0 and device CUDAPlace(0) [2021/06/25 14:07:43] root INFO: Initialize indexs of datasets:['./train_data/icdar2015/text_localization/train_icdar2015_label.txt'] [2021/06/25 14:07:43] root INFO: Initialize indexs of datasets:['./train_data/icdar2015/text_localization/test_icdar2015_label.txt'] W0625 14:07:43.746914 18728 device_context.cc:404] Please NOTE: device: 0, GPU Compute Capability: 6.1, Driver API Version: 11.0, Runtime API Version: 11.0 W0625 14:07:43.753896 18728 device_context.cc:422] device: 0, cuDNN Version: 8.0. [2021/06/25 14:07:45] root INFO: load pretrained model from ['./pretrain_models/MobileNetV3_large_x0_5_pretrained'] [2021/06/25 14:07:45] root INFO: train dataloader has 63 iters [2021/06/25 14:07:45] root INFO: valid dataloader has 500 iters [2021/06/25 14:07:45] root INFO: During the training process, after the 0th iteration, an evaluation is run every 2000 iterations [2021/06/25 14:07:45] root INFO: Initialize indexs of datasets:['./train_data/icdar2015/text_localization/train_icdar2015_label.txt']

请教是什么问题导致的?谢谢

MissPenguin commented 3 years ago

save_epoch_step: 100

所以每训练100个epoch才会保存一次模型,你这才刚刚启动训练

eval_batch_step: [0, 2000] 另外每2000次迭代会进行一次评估,这时会保存一个best_accuracy模型,可以把这个参数调小,就能比较快看到保存的模型了

paddle-bot-old[bot] commented 3 years ago

Since you haven\'t replied for more than 3 months, we have closed this issue/pr. If the problem is not solved or there is a follow-up one, please reopen it at any time and we will continue to follow up. It is recommended to pull and try the latest code first. 由于您超过三个月未回复,我们将关闭这个issue/pr。 若问题未解决或有后续问题,请随时重新打开(建议先拉取最新代码进行尝试),我们会继续跟进。