PaddleOCR icon indicating copy to clipboard operation
PaddleOCR copied to clipboard

RuntimeError: (PreconditionNotMet) The third-party dynamic library (cudnn64_8.dll) that Paddle depends on is not configured correctly. (error code is 126)

Open gtbloody opened this issue 1 year ago • 3 comments

运行paddleocr --image_dir E:\PaddleOCR\img1.pdf --use_angle_cls true --use_gpu true的时候报错,这是找不到cudnn64_8.dll?

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:301)

———————————————————————————— 以上是报错,以下是我电脑和环境的情况,cuda版本11.8,用python -m pip install paddlepaddle-gpu==2.5.2 -i https://pypi.tuna.tsinghua.edu.cn/simple 安装的paddlepaddle-gpu,用pip install paddleocr安装的paddleocr2.7.0.3 ————————————————————————————

(base) (venv) PS E:\PaddleOCR> pip list Package Version


albumentations 1.3.1 anyio 4.0.0 astor 0.8.1 attrdict 2.0.1 Babel 2.13.1 bce-python-sdk 0.8.95 beautifulsoup4 4.12.2 blinker 1.7.0 cachetools 5.3.2 certifi 2023.7.22 charset-normalizer 3.2.0 click 8.1.7 colorama 0.4.6 contourpy 1.1.0 cssselect 1.2.0 cssutils 2.9.0 cycler 0.11.0 Cython 3.0.5 decorator 5.1.1 et-xmlfile 1.1.0 exceptiongroup 1.1.3 filelock 3.12.2 fire 0.5.0 Flask 3.0.0 flask-babel 4.0.0 fonttools 4.42.0 future 0.18.3 glog 0.3.1 h11 0.14.0 httpcore 1.0.1 httpx 0.25.1 idna 3.4 imageio 2.31.1 imgaug 0.4.0 itsdangerous 2.1.2 Jinja2 3.1.2 joblib 1.3.2 kiwisolver 1.4.4 lmdb 1.4.1 lxml 4.9.3 MarkupSafe 2.1.3 matplotlib 3.7.2 mpmath 1.3.0 munch 4.0.0 networkx 3.1 numpy 1.25.2 opencv-contrib-python 4.6.0.66 opencv-python 4.6.0.66 opencv-python-headless 4.8.0.76 openpyxl 3.1.2 opt-einsum 3.3.0 packaging 23.1 paddleocr 2.7.0.3 paddlepaddle-gpu 2.5.2 pandas 2.1.2 pdf2docx 0.5.6 Pillow 10.0.0 pip 23.3.1 premailer 3.10.0 pretrainedmodels 0.7.4 protobuf 3.20.2 psutil 5.9.6 pyclipper 1.3.0.post5 pycryptodome 3.19.0 PyMuPDF 1.20.2 pyparsing 3.0.9 python-dateutil 2.8.2 python-docx 1.1.0 python-gflags 3.1.2 pytz 2023.3.post1 PyWavelets 1.4.1 PyYAML 6.0.1 qudida 0.0.4 rapidfuzz 3.5.2 rarfile 4.1 requests 2.31.0 scikit-image 0.18.1 scikit-learn 1.3.0 scipy 1.11.1 setuptools 68.2.0 shapely 2.0.2 six 1.16.0 sniffio 1.3.0 soupsieve 2.5 sympy 1.12 tensorboardX 2.6.2 termcolor 2.3.0 threadpoolctl 3.2.0 tifffile 2023.8.12 torch 2.0.1+cu118 torchaudio 2.0.2+cu118 torchsummary 1.5.1 torchvision 0.15.2+cu118 tqdm 4.66.1 typing_extensions 4.7.1 tzdata 2023.3 urllib3 2.0.4 visualdl 2.5.3 Werkzeug 3.0.1 wheel 0.41.2 (base) (venv) PS E:\PaddleOCR> nvcc -V nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2022 NVIDIA Corporation Built on Wed_Sep_21_10:41:10_Pacific_Daylight_Time_2022 Cuda compilation tools, release 11.8, V11.8.89 Build cuda_11.8.r11.8/compiler.31833905_0

gtbloody avatar Nov 08 '23 19:11 gtbloody

解决了,是我没装cudnn,把cudnn压缩包里bin目录下的cudnn64_8.dll等7个文件解压到C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin里就好了

gtbloody avatar Nov 08 '23 20:11 gtbloody

在实际应用过程中可能受多种影响缺的不只单个动态链接库,可以看下这个https://blog.csdn.net/shuaishishi/article/details/136619380?spm=1001.2014.3001.5501

psgetit avatar Mar 11 '24 06:03 psgetit

解决了,是我没装cudnn,把cudnn压缩包里bin目录下的cudnn64_8.dll等7个文件解压到C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin里就好了

现在下载下来的v9版本后缀都是_9,把cudnn64_9.dll复制一份名称改成cudnn64_8.dll也能用。

AlphaBoom avatar May 08 '24 15:05 AlphaBoom