Replies: 2 comments 5 replies
-
Answer1. Why is the fine-tuned model predicting Chinese characters?The issue of your fine-tuned model predicting Chinese characters instead of English is most likely related to a mismatch in the character dictionary (
Steps to Fix the Issue:
2. Suggestions to Improve Training Results:
3. Related Discussions:
Response generated by feifei-bot | chatgpt-4o-latest |
Beta Was this translation helpful? Give feedback.
-
@l03126 please share your config file as it is. I think you have modified a lot. Have you removed the GTC strategy and many other stuff? |
Beta Was this translation helpful? Give feedback.
-
Im finetuning en_PPOCRv4_rec_train. I have a small dataset (1300 images for training) however the training outputs does not seem bad. I have an issue with the model output.
YML file:
Trained with Kaggle Multi GPU using :
!python3 -m paddle.distributed.launch --gpus '0,1' /kaggle/working/finetune_paddle_ocr/PaddleOCR/tools/train.py -c /kaggle/working/yml_file/rec_configs.yml
Training output:
After the training was completed I exported the best_accuracy to inference model with
!python3 /kaggle/working/finetune_paddle_ocr/PaddleOCR/tools/export_model.py -c /kaggle/working/yml_file/rec_configs.yml -o Global.pretrained_model=/kaggle/working/finetuned_model/best_accuracy Global.save_inference_dir=/kaggle/working/inference/finetuned_en_PP-OCRv4_rec/
and ran inference with
!python3 /kaggle/working/finetune_paddle_ocr/PaddleOCR/tools/infer/predict_rec.py --rec_model_dir /kaggle/working/inference/finetuned_en_PP-OCRv4_rec --image_dir /kaggle/input/recognition-data/test --rec_char_dict_path /kaggle/working/finetune_paddle_ocr/PaddleOCR/ppocr/utils/en_dict.txt --rec_image_shape='3,80,800'
And I got the outputs for the images as expected. It wasn't the best. But it was satisfactory.
However, when I tried the below code to directly compare the original model and my new one directly:
My finetuned model started predicting in Chinese
I checked inference.yml and the character_dict: has only Eng characters and symbols.
Questions:
What possibly can be the issue with the model such that it outputs Chinese chars when running as such?
Any suggestions to change my yml file configs to further improve the training results? How would do go about using VisualDL to view real-time outputs from Kaggle Notebook?
Hey @VishyAnand28 any input is greatly appreciated. Do you have any experience working with VisualDL as well?
Beta Was this translation helpful? Give feedback.
All reactions