Skip to content

The prediction result of OCR model is wrong by using mkldnn. #35794

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

Closed
baoachun opened this issue Sep 16, 2021 · 4 comments
Closed

The prediction result of OCR model is wrong by using mkldnn. #35794

baoachun opened this issue Sep 16, 2021 · 4 comments
Assignees
Labels

Comments

@baoachun
Copy link
Contributor

baoachun commented Sep 16, 2021

图片

Download ch_PP-OCRv2_rec, ch_ppocr_mobile_v2.0_rec and ch_ppocr_server_v2.0_rec from https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.3/doc/doc_en/models_list_en.md.

Then
git clone https://github.com/PaddlePaddle/PaddleOCR.git
cd PaddleOCR
git checkout develop
python3 tools/infer/predict_rec.py --image_dir=doc/imgs_words/ch/word_1.jpg --rec_model_dir=./rec_models_ch/ch_PP-OCRv2_rec_infer --rec_image_shape="3, 32, 100" --rec_char_type="ch" --rec_char_dict_path="./ppocr/utils/ppocr_keys_v1.txt" --rec_algorithm=CRNN --use_gpu=False --use_tensorrt=False --enable_mkldnn=True --rec_batch_num=1

@paddle-bot-old
Copy link

您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网API文档常见问题历史IssueAI社区来寻求解答。祝您生活愉快~

Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the APIFAQGithub Issue and AI community to get the answer.Have a nice day!

@jakpiase
Copy link
Contributor

Hi @baoachun, I have downloaded ch_PP-OCRv2_rec_infer.tar, I have also changed filenames from "inference..pdiparams" to "params" and from "inference.pdmodel" to "model" and I am getting "list index out of range" error when I run
python tools/infer/predict_rec.py --image_dir=doc/imgs_words/ch/word_1.jpg --rec_model_dir=./rec_models_ch/ch_PP-OCRv2_rec_infer --rec_image_shape="3, 32, 100" --rec_char_type="ch" --rec_char_dict_path="./ppocr/utils/ppocr_keys_v1.txt" --rec_algorithm=CRNN --use_gpu=False --use_tensorrt=False --enable_mkldnn=True --rec_batch_num=1
Could you please give me more detailed steps how to reproduce this issue?

@jakpiase
Copy link
Contributor

Hi @baoachun, @JiaXiao243 sent a screenshot in #35781 that disabling reshape and squeeze ops fixes both ch_PP-OCRv2_rec_infer and shufflenetv2, can I close these two issues?

@baoachun
Copy link
Contributor Author

@jakpiase
Yep,thank you.

@jakpiase jakpiase assigned jakpiase and unassigned Thunderbrook Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants