PaddleOCR
PaddleOCR copied to clipboard
Loss of accuracy in recognizing when exporting a trained model
System Environment: Windows 11, Python 3.9.9
Version: Paddle 2.7+ PaddleOCR
I trained a recognition model using the configuration file config.yml and obtained excellent results on my dataset. However, after exporting the model for inference, the accuracy significantly decreases. Command code: python PaddleOCR/tools/export_model.py -c config.yml -o Global.pretrained_model="output/rec/mark/best_accuracy" Global.save_inference_dir=./mark Configuration file: Global: use_gpu: true epoch_num: 250 log_smooth_window: 20 print_batch_step: 10 save_model_dir: ./output/rec/mark1/ save_epoch_step: 3
eval_batch_step: [0, 2000] cal_metric_during_train: True pretrained_model: checkpoints: save_inference_dir: ./mark use_visualdl: TRue infer_img: doc/imgs_words_en/word_10.png
character_dict_path: ../Practice1/ppocr/utils/dict1.txt character_type: EN max_text_length: 25 infer_mode: True use_space_char: False save_res_path: ./output/rec/dict1_0.txt
Optimizer: name: Adam beta1: 0.9 beta2: 0.999 lr: learning_rate: 0.0005 regularizer: name: 'L2' factor: 0
Architecture: model_type: rec algorithm: CRNN Transform: Backbone: name: MobileNetV3 scale: 0.5 model_name: large Neck: name: SequenceEncoder encoder_type: rnn hidden_size: 96 Head: name: CTCHead fc_decay: 0
Loss: name: CTCLoss
PostProcess: name: CTCLabelDecode
Metric: name: RecMetric main_indicator: acc
Train: dataset: name: SimpleDataSet data_dir: ../Practice1/dataset/train/images/ label_file_list: ['../Practice1/dataset/train/train_annotation.txt'] transforms: - DecodeImage: # load image img_mode: BGR channel_first: False - CTCLabelEncode: # Class handling label - RecResizeImg: image_shape: [3, 32, 100] - KeepKeys: keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order loader: shuffle: True batch_size_per_card: 256 drop_last: True num_workers: 8 use_shared_memory: False
Eval: dataset: name: SimpleDataSet data_dir: ../Practice1/dataset/val/images/ label_file_list: ['../Practice1/dataset/val/val_annotation.txt'] transforms: - DecodeImage: # load image img_mode: BGR channel_first: False - CTCLabelEncode: # Class handling label - RecResizeImg: image_shape: [3, 32, 100] - KeepKeys: keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order loader: shuffle: False drop_last: False batch_size_per_card: 256 num_workers: 4 use_shared_memory: False
What am I doing wrong?