Download Anaconda3. I found it on Baidu conda 清华镜像. The address is the conda Tsinghua mirror download address . The downloaded version is Anaconda3-2019.10-Windows-x86_64.exe. This version supports Python3.7.4.
Double-click to install and follow the default options until the next step.
Check if the installation is successful, conda list.
Since the image source is from abroad, add the image of the Chinese Academy of Sciences and use conda config.
Next create a conda environment and use the following commands
The creation command conda create -n tf2_gpu python=3.6.5supports Python 3.7, but I used Python 3.6 here. conda env listYou can check which environments have been created.
When using jupyter notebook, you sometimes switch between different kernels. Then you need to install nb_conda_kernels and ipykernel in the tf2_gpu environment . First, switch to installing and respectively .conda activate tf2_gpuconda install nb_conda_kernelsconda install ipykernel
Associate kernel and environmentpython -m ipykernel install --name tf2_gpu
Modify the default configuration of jupyter C:\Users\Administrator.jupyter 's starting directory c.NotebookApp.notebook_dir = 'D:\\00.codes\\jupyter', and then type the command jupyter notebookto start jupyter.
Delete a conda imageconda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda environment transfer copy
Conda exports the existing environment: conda env export > environment.yamlThe environment will be saved in the environmen.yaml file and used to recreate the environment.
Conda reproduces the installation environment: conda env create -f environment.yamlThe transplanted environment only installs the packages you installed directly with conda install and other commands in the original environment. Things you installed with pip and the like are not transplanted and need to be reinstalled.
Transfer and copy of pip package
pip exports the installed libraries to requirements.txt:pip freeze > requirements.txt
pip imports the libraries listed in requirements.txt into the system:pip install -r requirements.txt
2.Install NVIDIA CUDA
Check whether your computer supports the version and driver of CUDA. You can check it like this: NVIDIA Control Panel > Help > System Information > Components and check NVCUDA64.DLL in 3D settings.
First go to the official website to downloadcuda_10.1.243_426.00_win10.exe
Then install it. If VS is not installed on the computer, do not choose it.
CUDA installation confirmation
.CUPTI Confirm
3. Install CUDNN
First, go to the tensorflow official website to confirm the version correspondence. For example, if I install tensorflow_gpu-2.2.0 here, I need to install cuda10.1 and cudnn7.6.
Go to the cudnn official website to download the version corresponding to cuda10.1, which requires registration.
Unzip, then rename the folder cudnnand copy it to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1the following, as shown in the figure