PaddlePaddle / PaddlePaddle/PaddleOCR
模型导出后使用和直接运行tools/infer_rec.py结果不同
@zhang-prog is already working on this.
Since Jan 23, 2026.
- Dominant language
- Python
- Stars
- 89.8k
- Forks
- 11.4k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 2
Description
🔎 Search before asking
- I have searched the PaddleOCR Docs and found no similar bug report.
- I have searched the PaddleOCR Issues and found no similar bug report.
- I have searched the PaddleOCR Discussions and found no similar bug report.
🐛 Bug (问题描述)
模型导出后inference结果错误:使用tools/export_model.py导出训练后的模型,在paddlex中使用,对相同的图片,inference结果错误。但是使用python tools/infer_rec.py进行推理,结果是正确的。请问可能是什么原因导致的?
🏃♂️ Environment (运行环境)
OS Linux
python 3.9
CUDA 11.1
🌰 Minimal Reproducible Example (最小可复现问题的Demo)
1、
from paddlex import create_model
model = create_model(model_name="PP-OCRv5_server_rec", model_dir="../PaddleOCR/output/PP-OCRv5_server_rec_infer")
output = model.predict(input="xxxxxx.jpg", batch_size=1)
推理结果:'rec_text': '溪梧溪梧溪梧胞業溪馮數馮環馮業溪馮溪業溪', 'rec_score': 0.03143063932657242
2、PaddleOCR中直接运行
python tools/infer_rec.py -c configs/rec/PP-OCRv5/PP-OCRv5_server_rec.yml(yml中以及设置好相同的推理图片路径和模型路径)
推理结果:rec_text: 仲仁射 rec_score:0.7235490679740906
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.