Closed h6266427 closed 3 years ago
@LDOUBLEV @littletomatodonkey @dyning @WenmuZhou @tink2123 @MissPenguin Please help me! Emergency!
我通过使用原来的yml配置文件来生成推理模型,从而解决了这个问题。 I solved this issue by using the original configuration file :"rec_chinese_lite_train_v1.1.yml". So I can close this issue.
@h6266427 did you retrain using the original configuration file or do you evaluate using that file?
@h6266427 did you retrain using the original configuration file or do you evaluate using that file?
@leminhyen2 In evaluating.
我用ch_ppocr_mobile_v1.1_rec的“训练模型” (注意是训练模型,不是预训练模型)上进行finetune,训练收敛后acc达到0.75,我使用export_model得出的推理模型进行推理,结果输入图片得不到输出,用infer_rec.py也一样。 而用我自己从头开始训的模型则可以正常识别,请问是哪里出了问题?
我的yml配置文件如下: 主要修改了max_text_length,从25改为44训练
===========rec_chinese_lite_train_v1.1.yml=================== Global: algorithm: CRNN use_gpu: true epoch_num: 1000 log_smooth_window: 1 print_batch_step: 1 save_model_dir: ./output/ch_ppocr_rec_train_ft_lr0005 save_epoch_step: 10 eval_batch_step: 10 train_batch_size_per_card: 256 test_batch_size_per_card: 8 image_shape: [3, 32, 320] max_text_length: 44 character_type: ch character_dict_path: ./ppocr/utils/ppocr_keys_v1.txt loss_type: ctc distort: true use_space_char: true reader_yml: ./configs/rec/rec_chinese_reader.yml pretrain_weights: output/ch_ppocr_mobile_rec_train/best_accuracy checkpoints: save_inference_dir: infer_img:
Architecture: function: ppocr.modeling.architectures.rec_model,RecModel
Backbone: function: ppocr.modeling.backbones.rec_mobilenet_v3,MobileNetV3 scale: 0.5 model_name: small small_stride: [1, 2, 2, 2]
Head: function: ppocr.modeling.heads.rec_ctc_head,CTCPredict encoder_type: rnn fc_decay: 0.00001 SeqRNN: hidden_size: 48
Loss: function: ppocr.modeling.losses.rec_ctc_loss,CTCLoss
Optimizer: function: ppocr.optimizer,AdamDecay base_lr: 0.0005 #0.0005 l2_decay: 0.00001 beta1: 0.9 beta2: 0.999 decay: function: cosine_decay_warmup step_each_epoch: 254 total_epoch: 500 warmup_minibatch: 1000
推理时的输出如下:
2020-12-23 16:01:38,251-INFO: infer_img:./train_data/test/chinise.png
2020-12-23 16:01:38,311-INFO: infer_img:./train_data/test/16.png
2020-12-23 16:01:38,366-INFO: infer_img:./train_data/test/68783387CHN9006.png
2020-12-23 16:01:38,429-INFO: infer_img:./train_data/test/OCT.png
2020-12-23 16:01:38,486-INFO: infer_img:./train_data/test/he.png
2020-12-23 16:01:38,569-INFO: infer_img:./train_data/test/MOMBPK__.png
没有识别结果!!