PaddleOCR icon indicating copy to clipboard operation
PaddleOCR copied to clipboard

Can't Run the model on GPU,but CPU is fine. (error code is 126)

Open B1029038 opened this issue 7 months ago • 4 comments

问题描述 / Problem Description

运行环境 / Runtime Environment

  • OS:windows
  • Paddle:follow the quick start
  • PaddleOCR:follow the quick start

复现代码 / Reproduction Code

皆按照quickstart的步驟進行

完整报错 / Complete Error Message

Traceback (most recent call last): File "C:\Users\USER\Desktop\ppocr_img\test2.py", line 173, in process_folder(input_folder) File "C:\Users\USER\Desktop\ppocr_img\test2.py", line 170, in process_folder process_and_ocr(warped_images, os.path.splitext(filename)[0]) File "C:\Users\USER\Desktop\ppocr_img\test2.py", line 110, in process_and_ocr result = ocr.ocr(np.array(image), cls=True) File "C:\Users\USER\anaconda3\envs\paddle_env\lib\site-packages\paddleocr\paddleocr.py", line 729, in ocr dt_boxes, rec_res, _ = self.call(img, cls, slice) File "C:\Users\USER\anaconda3\envs\paddle_env\lib\site-packages\paddleocr\tools\infer\predict_system.py", line 109, in call dt_boxes, elapse = self.text_detector(img) File "C:\Users\USER\anaconda3\envs\paddle_env\lib\site-packages\paddleocr\tools\infer\predict_det.py", line 394, in call dt_boxes, elapse = self.predict(img) File "C:\Users\USER\anaconda3\envs\paddle_env\lib\site-packages\paddleocr\tools\infer\predict_det.py", line 254, in predict self.input_tensor.copy_from_cpu(img) File "C:\Users\USER\anaconda3\envs\paddle_env\lib\site-packages\paddle\inference\wrapper.py", line 52, in tensor_copy_from_cpu self._copy_from_cpu_bind(data) RuntimeError: (PreconditionNotMet) The third-party dynamic library (cudnn64_8.dll) that Paddle depends on is not configured correctly. (error code is 126) Suggestions:

  1. Check if the third-party dynamic library (e.g. CUDA, CUDNN) is installed correctly and its version is matched with paddlepaddle you installed.
  2. Configure third-party dynamic library environment variables as follows:
  • Linux: set LD_LIBRARY_PATH by export LD_LIBRARY_PATH=...
  • Windows: set PATH by `set PATH=XXX; (at ..\paddle\phi\backends\dynload\dynamic_loader.cc:312)

可能解决方案 / Possible solutions

照著教學的進行,在anaconda環境中載了 pip install paddlepaddle-gpu pip install paddleocr 但還是無法順利在gpu上運行,cpu是可以正常運行的。 Follow the quick start, I install these thing in anaconda pip install paddlepaddle-gpu pip install paddleocr but the model still can't run on gpu, its ok to run on cpu

附件 / Appendix

B1029038 avatar Jul 16 '24 09:07 B1029038