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

OCR Cpu与Gpu推理结果不一致,Cpu错误 #2519

Open
panshuaisharon opened this issue Sep 3, 2024 · 0 comments
Open

OCR Cpu与Gpu推理结果不一致,Cpu错误 #2519

panshuaisharon opened this issue Sep 3, 2024 · 0 comments
Assignees

Comments

@panshuaisharon
Copy link


温馨提示:根据社区不完全统计,按照模板提问,可以加快回复和解决问题的速度


环境

  • 【FastDeploy版本】: fastdeploy-develop
  • 【系统平台】: Linux x64(Ubuntu 18.04) / Windows x64(Windows10)
  • 【硬件】: 说明具体硬件型号,如 Nvidia GPU 3090, CUDA 11.7 CUDNN 8.9
  • 【编译语言】: C++
  • 【PaddleOCR版本】:v2.8

【模型来源】:https://paddleocr.bj.bcebos.com/PP-OCRv3/english/en_PP-OCRv3_rec_train.tar
【模型导出】: python3 tools/export_model.py -c configs/rec/PP-OCRv3/en_PP-OCRv3_rec.yml -o Global.pretrained_model="pretrain/en_PP-OCRv3_rec_train/best_accuracy" Global.save_inference_dir="pretrain/en_PP-OCRv3_rec_train/exportold/"
【python版本CPU推理正确】:python tools/infer/predict_rec.py --rec_model_dir="pretrain/en_PP-OCRv3_rec_train/exportold/" --image_dir="testimg/3/" --rec_char_dict_path="ppocr/utils/en_dict.txt" --rec_image_shape="3,48,320" --use_gpu=false

[2024/09/03 16:12:09] ppocr INFO: Predicts of testimg/3/2C_105_58_52_0088288__train1_1.jpg:('70', 0.997565746307373)
[2024/09/03 16:12:09] ppocr INFO: Predicts of testimg/3/2C_105_58_52_0088288__train1_2.jpg:('61', 0.8275187015533447)
[2024/09/03 16:12:09] ppocr INFO: Predicts of testimg/3/long_00009204_error_train_1.jpg:('T3O', 0.2974623739719391)
【python版本GPU推理正确】python tools/infer/predict_rec.py --rec_model_dir="pretrain/en_PP-OCRv3_rec_train/exportold/" --image_dir="testimg/3/" --rec_char_dict_path="ppocr/utils/en_dict.txt" --rec_image_shape="3,48,320" --use_gpu=true

[2024/09/03 16:13:21] ppocr INFO: Predicts of testimg/3/2C_105_58_52_0088288__train1_1.jpg:('70', 0.9975684881210327)
[2024/09/03 16:13:21] ppocr INFO: Predicts of testimg/3/2C_105_58_52_0088288__train1_2.jpg:('61', 0.8278857469558716)
[2024/09/03 16:13:21] ppocr INFO: Predicts of testimg/3/long_00009204_error_train_1.jpg:('T3O', 0.2983874976634979)

【C++FastDeployGPU推理正确-ubuntu/windows】保证recshape设置正确,dict也正确,模型一致
结果
testimg/3/2C_105_58_52_0088288__train1_1.jpg:text=70 rec_prob=0.997568
Predicts of testimg/3/2C_105_58_52_0088288__train1_2.jpg:text=61 rec_prob=0.827548
Predicts of testimg/3/long_00009204_error_train_1.jpg:text=T3O rec_prob=0.297802

【C++FastDeployCPU推理错误-ubuntu/windows】保证recshape设置正确,dict也正确,模型一致
结果
testimg/3/2C_105_58_52_0088288__train1_1.jpg:text=70 rec_prob=0.745858
Predicts of testimg/3/2C_105_58_52_0088288__train1_2.jpg:text= rec_prob=0
Predicts of testimg/3/long_00009204_error_train_1.jpg:text= rec_prob=0

请问CPU推理如何改进可以正确推理呢?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants