NotImplementedError when using PaddleOCR 3.7.0 with PaddlePaddle 3.3.1
Author: yunyugongCreated Jun 14, 2026Updated Sep 12, 2026
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 (问题描述)
Bug Report: NotImplementedError when using PaddleOCR 3.7.0
Environment
- Operating System: Linux (Ubuntu/Debian)
- Python Version: 3.12
- PaddleOCR Version: 3.7.0
- PaddlePaddle Version: 3.3.1
- Device: CPU (GPU unavailable)
Problem Description
When running the command paddleocr ocr -i <image_path>, a NotImplementedError is thrown during the text detection phase.
Error Log
$ paddleocr ocr -i test.jpg --lang ch
Creating model: ('PP-LCNet_x1_0_doc_ori', None, None)
Model files already exist. Using cached files.
...
Resized image size (4032x3024) exceeds max_side_limit of 4000. Resizing to fit within limit.
Traceback (most recent call last):
File "/home/cai/qwen25/bin/paddleocr", line 6, in <module>
sys.exit(console_entry())
File "/home/cai/qwen25/lib/python3.12/site-packages/paddleocr/__main__.py", line 26, in console_entry
main()
File "/home/cai/qwen25/lib/python3.12/site-packages/paddleocr/_cli.py", line 309, in main
_execute(args)
File "/home/cai/qwen25/lib/python3.12/site-packages/paddleocr/_cli.py", line 298, in _execute
args.executor(args)
File "/home/cai/qwen25/lib/python3.12/site-packages/paddleocr/_pipelines/ocr.py", line 604, in execute_with_args
perform_simple_inference(PaddleOCR, params)
File "/home/cai/qwen25/lib/python3.12/site-packages/paddleocr/_utils/cli.py", line 68, in perform_simple_inference
for i, res in enumerate(result):
File "/home/cai/qwen25/lib/python3.12/site-packages/paddlex/inference/pipelines/_parallel.py", line 161, in predict
yield from self._pipeline.predict(
File "/home/cai/qwen25/lib/python3.12/site-packages/paddlex/inference/pipelines/ocr/pipeline.py", line 366, in predict
det_results = list(
File "/home/cai/qwen25/lib/python3.12/site-packages/paddlex/inference/models/predictors/base_predictor.py", line 117, in __call__
yield from self.apply(input, **kwargs)
File "/home/cai/qwen25/lib/python3.12/site-packages/paddlex/inference/models/predictors/base_predictor.py", line 140, in apply
pred = self.process(batch_data, **kwargs)
File "/home/cai/qwen25/lib/python3.12/site-packages/paddlex/inference/models/text_detection/predictor.py", line 145, in process
batch_preds = self.runner(x=x)
File "/home/cai/qwen25/lib/python3.12/site-packages/paddlex/inference/models/runners/paddle_static/runner.py", line 297, in __call__
pred = self.infer(x)
File "/home/cai/qwen25/lib/python3.12/site-packages/paddlex/inference/models/runners/paddle_static/runner.py", line 265, in __call__
self.predictor.run()
NotImplementedError: (Unimplemented) ConvertPirAttribute2RuntimeAttribute not support [pir::ArrayAttribute<pir::DoubleAttribute>] (at /paddle/paddle/fluid/framework/new_executor/instruction/onednn/onednn_instruction.cc:116)
Steps to Reproduce
- Install dependencies:
pip install paddleocr paddlepaddle -i https://pypi.tuna.tsinghua.edu.cn/simple - Execute the command:
paddleocr ocr -i test.jpg --lang ch - The above error occurs.
Expected Behavior
- Text in the image is recognized successfully
- Recognition results are returned in JSON format
Additional Information
- Model files have been downloaded to
~/.paddlex/official_models/completely - The same error occurs with different images
- The
--use_angle_clsparameter is prompted as deprecated - The identical error also appears when calling via Python API
♂️ Environment (运行环境)
Project Environment Configuration
Basic Environment
| Item | Configuration |
|---|---|
| Operating System | Linux (Ubuntu/Debian) |
| Compiler | GCC 12+ |
| Qt Version | Qt 5.15+ |
| CMake Version | 3.16+ |
Virtual Environment
# Virtual environment path
/home/cai/qwen25
# Activation command
source /home/cai/qwen25/bin/activate
Python Dependencies
| Package Name | Version | Purpose |
|---|---|---|
| paddleocr | 3.7.0 | OCR recognition (compatibility issue pending fix) |
| paddlepaddle | 3.3.1 | PaddlePaddle deep learning framework |
| numpy | 2.3.5 | Numerical computation |
| opencv-contrib-python | 4.10.0.84 | Image processing |
AI Service Configuration
LLM Service: SiliconFlow
- Model: Qwen/Qwen2.5-7B-Instruct
- API Key: Configured via environment variable
LLM_API_KEY
OCR Service: Tesseract (Default)
- Language Packs: chi_sim+eng (Chinese & English mixed recognition)
- Installation Command:
sudo apt install tesseract-ocr tesseract-ocr-chi-sim
Project Structure
/home/cai/Desktop/build/
├── ai-error-book/ # Core logic module
│ └── src/
│ ├── ai_api.h # AI API implementation
│ ├── config.h # Configuration file
│ ├── logger.h # Logging system
│ └── paddle_ocr.py # PaddleOCR script
└── ai-error-book-qt/ # Qt graphical interface
├── build/ # Compilation output directory
├── main.cpp # Entry file
├── mainwindow.cpp/.h # Main window
└── ocrwidget.cpp/.h # OCR recognition component
Startup Instructions
# Navigate to compilation directory
cd /home/cai/Desktop/build/ai-error-book-qt/build
# Set API key and launch the program
export LLM_API_KEY="your_api_key"
./ai-error-book-qt
Environment Variable Description
| Variable Name | Purpose | Default Value |
|---|---|---|
LLM_API_KEY |
SiliconFlow API key | None (Required) |
OCR_PROVIDER |
OCR service provider | tesseract |
LOG_LEVEL |
Logging level | INFO |
Minimal Reproducible Example (最小可复现问题的Demo)
Minimal Reproducible Example
Below is a minimal reproducible script to demonstrate the PaddleOCR bug:
#!/usr/bin/env python3
"""
Minimal Reproducible Example for PaddleOCR bug
GitHub Issue: NotImplementedError when using PaddleOCR 3.7.0
"""
import sys
from paddleocr import PaddleOCR
def main():
if len(sys.argv) < 2:
print("Usage: python reproduce_bug.py <image_path>")
sys.exit(1)
image_path = sys.argv[1]
try:
# Initialize OCR with default settings
ocr = PaddleOCR(lang='ch')
# Try to recognize text
print(f"[INFO] Trying to recognize image: {image_path}")
result = ocr.predict(image_path)
print("[INFO] Recognition successful!")
print(f"[INFO] Number of text boxes: {len(result)}")
except Exception as e:
print(f"[ERROR] {type(e).__name__}: {str(e)}")
import traceback
traceback.print_exc()
sys.exit(1)
if __name__ == "__main__":
main()
Usage
# 1. Activate the virtual environment
source /home/cai/qwen25/bin/activate
# 2. Create the test script
cat > reproduce_bug.py << 'EOF'
#!/usr/bin/env python3
from paddleocr import PaddleOCR
import sys
ocr = PaddleOCR(lang='ch')
result = ocr.predict(sys.argv[1])
print(f"Success: {len(result)} text boxes found")
EOF
# 3. Run the test (replace with your actual image path)
python reproduce_bug.py /home/cai/Desktop/微信图片_20260613212028_1_10.jpg
Expected Output (Normal Execution)
[INFO] Trying to recognize image: test.jpg
[INFO] Recognition successful!
[INFO] Number of text boxes: 42
Actual Output (Error Occurred)
[INFO] Trying to recognize image: test.jpg
[ERROR] NotImplementedError: (Unimplemented) ConvertPirAttribute2RuntimeAttribute not support [pir::ArrayAttribute<pir::DoubleAttribute>]
Traceback (most recent call last):
File "reproduce_bug.py", line 16, in main
result = ocr.predict(image_path)
...
Test File
You can generate a simple test image with the script below if needed:
# create_test_image.py
from PIL import Image, ImageDraw, ImageFont
img = Image.new('RGB', (400, 200), color='white')
draw = ImageDraw.Draw(img)
draw.text((20, 50), "Hello World!", fill='black')
draw.text((20, 100), "你好世界!", fill='black')
img.save('test.jpg')
This minimal example helps developers quickly troubleshoot the problem.
Source: PaddlePaddle/PaddleOCR