Could not load dynamic library 'cudart64_110.dll’的解决方法
问题本质就是GPU调用问题
tensorflow要调用GPU对程序进行训练, 但是并没有找到相应的驱动文件
How do I fix it?
First - 之前没有安装cuda
To install the prerequisites for GPU support in TensorFlow 2.1:
- Install your latest GPU drivers.
- Install CUDA 10.1.
- If the CUDA installer reports “you are installing an older driver version”, you may wish to choose a custom installation and deselect some components. Indeed, note that software bundled with CUDA including GeForce Experience, PhysX, a Display Driver, and Visual Studio integration are not required by TensorFlow.
- Also note that TensorFlow requires a specific version of the CUDA Toolkit unless you build from source; for TensorFlow 2.1 and 2.2, this is currently version 10.1.
- Install cuDNN.
- Download cuDNN v7.6.4 for CUDA 10.1. This will require you to sign up to the NVIDIA Developer Program.
- Unzip to a suitable location and add the bin directory to your PATH.
- Install tensorflow by
pip install tensorflow
. - You may need to restart your PC.
second - 安装了cuda-缺少了dll文件
In a conda
environment, this is what solved my problem (I was missing cudart64-100.dll
:
- Downloaded it from dll-files.com/CUDART64_100.DLL
- Put it in my conda environment at
C:\Users\<user>\Anaconda3\envs\<env name>\Library\bin
check if it’s working:
That’s all it took! You can double check if it’s working:
py import tensorflow as tf tf.config.experimental.list_physical_devices('GPU')