Skip to content

PaddleOCR 3.0.2 fails with paddlepaddle-gpu==2.6.2 due to missing set_optimization_level attribute #15846

Description

@Youssef-SH

🔎 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 (问题描述)

Trying to use PaddleOCR 3.0.2 with GPU on Colab (Tesla T4), but I get this error:

AttributeError: 'paddle.base.libpaddle.AnalysisConfig' object has no attribute 'set_optimization_level'

Seems like an incompatibility between paddleocr and paddlepaddle-gpu.

I just wanted to know:
– Is paddlepaddle-gpu still supported?
– What version combo is recommended to run PaddleOCR 3.0.2 on GPU without downgrading PaddleOCR?

I'm still learning, so any help would be greatly appreciated. Thanks in advance.

🏃‍♂️ Environment (运行环境)

paddleocr: 3.0.2
paddlepaddle-gpu: 2.6.2
Python: 3.11 (Colab)
CUDA: Tesla T4
OS: Google Colab / Ubuntu 22.04
Fails on: GPU inference only
Works fine on: CPU inference

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

from paddleocr import PaddleOCR

ocr = PaddleOCR(
    text_detection_model_name='PP-OCRv5_server_det',
    text_recognition_model_name='arabic_PP-OCRv3_mobile_rec',
    device='gpu'
)

ocr.predict('/content/test.png')

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions