Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem in inference of custom trained model #10232

Closed
amm266 opened this issue Jun 22, 2023 · 5 comments
Closed

problem in inference of custom trained model #10232

amm266 opened this issue Jun 22, 2023 · 5 comments
Assignees
Labels
expneeded need extra experiment to fix issue good first issue Good for newcomers status/close

Comments

@amm266
Copy link

amm266 commented Jun 22, 2023

  • 系统环境/System Environment:win11 on CPU core i7 7700HQ
  • 版本号/Version: Paddle:2.4.2 PaddleOCR:2.6 on GitHub
    Hi, I've tried to train the paddle ocr model on a single photo to get used to its training pipeline and prepare for an actual project.
    I've reached good results in training (acc = 0.99) but when I export the model and try its inference by the same picture I get irrelevant results.
    model config file
    train log
    char_dict_file
    train image txt file
    picture:
    img1

train command: python tools/train.py -c configs/rec/PP-OCRv3/multi_language/kart_melly.yml

export command:python .\tools\export_model.py -c configs/rec/PP-OCRv3/multi_language/kart_melly.yml [2023/06/23 00:07:31] ppocr INFO: train from scratch [2023/06/23 00:07:34] ppocr INFO: inference model is saved to ./output/v3_kart_melly_inference\inference

inference command: python tools/infer/predict_rec.py --image_dir="./train/dataset/img1.png" --rec_model_dir="output\v3_kart_melly_inference" --rec_char_dict_path="ppocr/utils/dict/word_dict_fa.txt" E0623 00:08:03.743561 8404 analysis_config.cc:110] Please use PaddlePaddle with GPU version. [2023/06/23 00:08:03] ppocr INFO: In PP-OCRv3, rec_image_shape parameter defaults to '3, 48, 320', if you are using recognition model with PP-OCRv2 or an older version, please set --rec_image_shape='3,32,320 [2023/06/23 00:08:04] ppocr INFO: Predicts of ./train/dataset/img1.png:('ازاف', 0.0291864313185215)

I am almost sure I am making a simple mistake but no matter how much I read the docs and search in issues I couldn't fix the problem.
thank's for your help.

@shiyutang shiyutang added the expneeded need extra experiment to fix issue label Jun 29, 2023
@livingbody
Copy link
Contributor

i cannot access files on drive.google.com.
but i'm sure you need the correct char_dict_file to solve this problem.

@amm266
Copy link
Author

amm266 commented Jun 30, 2023

i cannot access files on drive.google.com. but i'm sure you need the correct char_dict_file to solve this problem.

I rechecked the links and all files are set to view for anyone with the link.
[https://drive.google.com/drive/folders/1bx37mhwWZmkdyANZeRC2pQXpdLVnfWzo?usp=drive_link](google drive folder)
in which command do you think char_dict_file is not set correctly?
I set it in the inference command and yml file to the same file.

@livingbody
Copy link
Contributor

i cannot access files on drive.google.com. but i'm sure you need the correct char_dict_file to solve this problem.

I rechecked the links and all files are set to view for anyone with the link. [https://drive.google.com/drive/folders/1bx37mhwWZmkdyANZeRC2pQXpdLVnfWzo?usp=drive_link](google drive folder) in which command do you think char_dict_file is not set correctly? I set it in the inference command and yml file to the same file.

Please use https://aistudio.baidu.com/aistudio/index or pan.baidu.com and share the project or file with me。 I cannot access google products for some reasons...

@shiyutang shiyutang added the good first issue Good for newcomers label Jul 4, 2023
@livingbody
Copy link
Contributor

the problem is solved.
please give me five, share the experience, and close the issue.

@livingbody
Copy link
Contributor

Problem Resolution

  • Pre-trained models using English characters
  • Use the pre-trained model that comes with the profile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
expneeded need extra experiment to fix issue good first issue Good for newcomers status/close
Projects
None yet
Development

No branches or pull requests

5 participants