Version Information
My computer graphics card is GeForce GTX1650
cuda version 10.1
cudnn version 7.6
python3.7
tensorflow-gpu 2.2.0
keras2.3.1
(To mention that the premise of my installation is that anaconda and python have been installed)
You can find your own graphics card version and the corresponding cuda version on the Internet (you will have time to add the viewing method later)
View the correspondence between tensorflow, keras, and python versions
View the corresponding relationship on the tensorflow official website: Building from source code in a Windows environment | TensorFlow (google.cn)
cuda installation
If CUDA has been installed locally before, you only need to install cudatoolkit in specific use , and you don't need to download the entire CUDA.
conda install cudatoolkit=10.1
cudnn installation
conda install cudnn=7.6
Just hit y here
The installation is complete
tensorflow-gpu installation
CUDA and cuDNN are downloaded using the conda command, and Tensorflow and keras are downloaded through the pip command
pip install tensorflow-gpu==2.2.0
The gpu version of tensorflow is installed successfully, check whether it is available:
way1:
import tensorflow as tf
print(tf.__version__)
tf.test.is_gpu_available()
The result is shown in the figure below, if true is available
way2:
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())
The result is shown below
install keras
Install the keras library using the pip command
pip install keras==2.3.1
Check if the installation is successful:
import keras
keras.__version__
The version number of the keras library is 2.3.1, and the installation is successful