PaddleOCR icon indicating copy to clipboard operation
PaddleOCR copied to clipboard

Farsi/Persian inference

Open Parisa-Bagherzadeh opened this issue 5 months ago • 1 comments

🔎 Search before asking

  • [x] I have searched the PaddleOCR Docs and found no similar bug report.
  • [x] I have searched the PaddleOCR Issues and found no similar bug report.
  • [x] I have searched the PaddleOCR Discussions and found no similar bug report.

🐛 Bug (问题描述)

I ran this code :

from paddleocr import PaddleOCR ocr = PaddleOCR(lang="fa") result = ocr.predict("hand2.jpg") for res in result: res.print()

res.save_to_img("result")

and got this error :

self.model_name, self.model_dir, self.MODEL_FILE_PREFIX, self._pp_option

AttributeError: 'TextRecPredictor' object has no attribute '_pp_option'. Did you mean: 'pp_option'?

🏃‍♂️ Environment (运行环境)

Package Version


aiohappyeyeballs 2.6.1 aiohttp 3.13.1 aiosignal 1.4.0 aistudio-sdk 0.3.8 albucore 0.0.24 albumentations 2.0.8 annotated-types 0.7.0 anyio 4.11.0 attrdict 2.0.1 attrs 25.4.0 babel 2.17.0 bce-python-sdk 0.9.46 beautifulsoup4 4.14.2 blinker 1.9.0 cachetools 6.2.1 certifi 2025.10.5 chardet 5.2.0 charset-normalizer 3.4.4 click 8.3.0 colorlog 6.10.1 contourpy 1.3.3 cssselect 1.3.0 cssutils 2.11.1 cycler 0.12.1 Cython 3.1.5 dataclasses-json 0.6.7 distro 1.9.0 einops 0.8.1 et_xmlfile 2.0.0 filelock 3.20.0 fire 0.7.1 Flask 3.1.2 flask-babel 4.0.0 fonttools 4.60.1 frozenlist 1.8.0 fsspec 2025.9.0 ftfy 6.3.1 future 1.0.0 greenlet 3.2.4 h11 0.16.0 hf-xet 1.1.10 httpcore 1.0.9 httpx 0.28.1 httpx-sse 0.4.3 huggingface-hub 0.35.3 idna 3.11 imageio 2.37.0 imagesize 1.4.1 imgaug 0.4.0 intel-cmplr-lib-rt 2025.0.4 intel-cmplr-lib-ur 2025.0.4 intel-cmplr-lic-rt 2025.0.4 intel-pti 0.10.1 intel-sycl-rt 2025.0.4 itsdangerous 2.2.0 Jinja2 3.1.6 jiter 0.11.1 joblib 1.5.2 jsonpatch 1.33 jsonpointer 3.0.0 kintera 1.1.0 kiwisolver 1.4.9 langchain 0.3.27 langchain-classic 1.0.0 langchain-community 0.4 langchain-core 0.3.79 langchain-openai 1.0.0 langchain-text-splitters 0.3.11 langgraph 1.0.0 langgraph-checkpoint 2.1.2 langgraph-prebuilt 1.0.0 langgraph-sdk 0.2.9 langsmith 0.4.37 lazy_loader 0.4 lmdb 1.7.5 lxml 6.0.2 MarkupSafe 3.0.3 marshmallow 3.26.1 matplotlib 3.10.7 modelscope 1.31.0 more-itertools 10.8.0 mpmath 1.3.0 multidict 6.7.0 mypy_extensions 1.1.0 networkx 3.5 numpy 2.3.4 openai 2.5.0 opencv-contrib-python 4.10.0.84 opencv-python 4.6.0.66 opencv-python-headless 4.12.0.88 openpyxl 3.1.5 opt-einsum 3.3.0 orjson 3.11.3 ormsgpack 1.11.0 packaging 25.0 paddle 1.1.1 paddleocr 3.3.0 paddlepaddle 3.2.0 paddlex 3.3.4 pandas 2.3.3 pdf2docx 0.5.8 pillow 12.0.0 pip 25.2 premailer 3.10.0 prettytable 3.16.0 propcache 0.4.1 protobuf 6.33.0 psutil 7.1.1 py-cpuinfo 9.0.0 pyclipper 1.3.0.post6 pycryptodome 3.23.0 pydantic 2.12.3 pydantic_core 2.41.4 pydantic-settings 2.11.0 pydisort 1.3.3 pyharp 1.7.6 PyMuPDF 1.20.2 pyparsing 3.2.5 pypdfium2 4.30.0 python-bidi 0.6.6 python-dateutil 2.9.0.post0 python-docx 1.2.0 python-dotenv 1.1.1 pytorch-triton-xpu 3.3.1 pytz 2025.2 PyYAML 6.0.2 RapidFuzz 3.14.1 rarfile 4.2 regex 2025.9.18 requests 2.32.5 requests-toolbelt 1.0.0 ruamel.yaml 0.18.15 ruamel.yaml.clib 0.2.14 safetensors 0.6.2 scikit-image 0.25.2 scikit-learn 1.7.2 scipy 1.16.2 sentencepiece 0.2.1 setuptools 65.5.0 shapely 2.1.2 simsimd 6.5.3 six 1.17.0 snapy 0.7.0 sniffio 1.3.1 soupsieve 2.8 SQLAlchemy 2.0.44 stringzilla 4.2.1 sympy 1.14.0 tcmlib 1.2.0 tenacity 9.1.2 termcolor 3.1.0 threadpoolctl 3.6.0 tifffile 2025.10.16 tiktoken 0.12.0 tokenizers 0.22.1 torch 2.7.1+xpu tqdm 4.67.1 typing_extensions 4.15.0 typing-inspect 0.9.0 typing-inspection 0.4.2 tzdata 2025.2 ujson 5.11.0 umf 0.9.1 urllib3 2.5.0 visualdl 2.5.3 wcwidth 0.2.14 Werkzeug 3.1.3 xxhash 3.6.0 yarl 1.22.0 zstandard 0.25.0

🌰 Minimal Reproducible Example (最小可复现问题的Demo)

How to inference on Farsi/Persian ?

Parisa-Bagherzadeh avatar Oct 22 '25 09:10 Parisa-Bagherzadeh

Thank you for your feedback! I tested the code you provided in my environment, using the same versions of PaddleX and PaddleOCR as you, and did not encounter any errors. Could you please try creating a new Python environment, then install the necessary packages and run the code again? This may help resolve the issue.

TingquanGao avatar Oct 24 '25 07:10 TingquanGao