AttributeError: module 'paddle' has no attribute 'device'
🔎 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 (问题描述)
pip freeze | grep -i paddle paddle==1.1.10 paddleocr==3.3.2 paddlex==3.3.4
Error seeing:
`
from paddleocr import PaddleOCRVL pipeline = PaddleOCRVL(vl_rec_backend="vllm-server", vl_rec_server_url="VLLM_SERVER_URL") Traceback (most recent call last): File "
", line 1, in File "/home/temirulan/miniconda3/envs/paddle/lib/python3.10/site-packages/paddleocr/_pipelines/paddleocr_vl.py", line 63, in init super().init(**kwargs) File "/home/temirulan/miniconda3/envs/paddle/lib/python3.10/site-packages/paddleocr/_pipelines/base.py", line 67, in init self.paddlex_pipeline = self._create_paddlex_pipeline() File "/home/temirulan/miniconda3/envs/paddle/lib/python3.10/site-packages/paddleocr/_pipelines/base.py", line 103, in _create_paddlex_pipeline kwargs = prepare_common_init_args(None, self._common_args) File "/home/temirulan/miniconda3/envs/paddle/lib/python3.10/site-packages/paddleocr/_common_args.py", line 63, in prepare_common_init_args device = get_default_device() File "/home/temirulan/miniconda3/envs/paddle/lib/python3.10/site-packages/paddlex/utils/device.py", line 44, in get_default_device if paddle.device.is_compiled_with_cuda() and paddle.device.cuda.device_count() > 0: AttributeError: module 'paddle' has no attribute 'device' `
🏃♂️ Environment (运行环境)
ubuntu 24.04
miniconda3
python3.10
🌰 Minimal Reproducible Example (最小可复现问题的Demo)
>>> from paddleocr import PaddleOCRVL
>>> pipeline = PaddleOCRVL(vl_rec_backend="vllm-server", vl_rec_server_url="VLLM_SERVER_URL")
It seems that you installed the wrong paddle package (a different third-party library, not PaddlePaddle).
To install the correct paddlepaddle package, please follow the official installation guide:
https://www.paddlepaddle.org.cn/en/install/quick?docurl=/documentation/docs/en/install/pip/macos-pip_en.html