PaddlePaddle / PaddlePaddle/FastDeploy
OCR Cpu与Gpu推理结果不一致,Cpu错误
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.7k
- Forks
- 756
- Avg merge
- 19h 28m
- Merged PRs (30d)
- 4
Description
温馨提示:根据社区不完全统计,按照模板提问,可以加快回复和解决问题的速度
环境
- 【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推理如何改进可以正确推理呢?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.