1. Set up the Python environment
To make a long story short, it is slow to install the Python environment and some common packages directly from Anaconda’s official website. You can use the open source image site of China to download the appropriate version:
Mirrors.tuna.tsinghua.edu.cn/anaconda/ar…
Anaconda3-2018.12-windows-x86_64 is used in this article, as newer versions may have various adaptation issues.
The installation process will not be described again, remember to check the “Configure environment variables” option that is not recommended
After the installation is successful, you can view the Python version:
2. Install the NVIDIA driver
Website address: www.nvidia.cn/geforce/dri…
Note: After searching for the appropriate driver, the DCH version driver will be downloaded by default. The following problems may occur during installation
Therefore, when downloading, you need to remove the DCH from the link and download the standard version driver
The one above is the standard version, don’t download the DCH version below.
3. Install the CUDA
Compute Unified Device Architecture (CUDA) is a parallel computing Architecture introduced by NVIDIA for its GPU, which enables GPU to perform massive parallel computing and solve complex computing problems.
CUDA is essentially a ToolKit, and CUDA 10 is the version chosen for this article
After the installation is successful, go to CMD and run the NVCC -v command to view the version information
4. Install CUDNN
As mentioned above, CUDA is not a GPU-accelerated library for neural networks. It is designed for all kinds of applications that require parallel computing. In order to train the neural network more quickly, an additional cuDNN installation is required.
NVIDIA CUDA® Deep Neural Network Library (cuDNN) is a GPU accelerated primitive library for deep neural networks. References to cuDNN provide highly optimized implementations for standard routines, such as forward and backward convolution, pooling, normalization, and activation layers.
In other words, cuDNN can be understood as an SDK, an accelerated package specifically for neural networks, and cuDNN v7.6.5.32 has been selected for this article
Decompress the cnDNN package and copy the CUDA folder to the CUDA installation directory. The default path used in this article is:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0
After decompression, you need to add its bin Path to the Path variable of the system variable and put this item at the top:
C: Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\ CUDA\ bin
5. Install TensorFlow
TensorFlow can be installed using the PIP install command when Anaconda is installed with the Python package management tool PIP installed
In order to speed up the installation, use the -i command to install qinghuyuan’s package. In this paper, version 2.0.0 of TensorFlow GPU is installed:
PIP install -u tensorflow – gpu = = 2.0.0 -i pypi.tuna.tsinghua.edu.cn/simple
Some packages may have errors during installation, such as wrapt installation failure
Execute commands to install the faulty packages separately, such as:
pip install -U –ignore-installed wrapt
Then reinstall TensorFlow
6. Hello World
Once installed, go to Hello World and type ipython in CMD and execute
import tensorflow as tf
The PIP show numpy command is used to check whether the current numpy version is 1.15.4
pip install –upgrade numpy -i pypi.tuna.tsinghua.edu.cn/simple
Upgrade version to 1.21.4
Try it againTensorFlow is now installed.
Refer to the reference
The installation package: blog.csdn.net/zimiao55214… Tsinghua source: pypi.tuna.tsinghua.edu.cn/simple