[Latest method] 2020.9.13
- Install the latest driver version that the graphics card can install (CUDA and CUDNN do not matter)
- Install the latest version of Anaconda, the PYTHON version does not matter, do not select all users during installation, check all the options that can be checked
conda create -n XXX
Create a new virtual environment under Powershell- In the new environment with
conda install tensorflow-gpu=XXX
specific versions of installed tensorflow, will be automatically installed and cudnn cuda corresponding version in the new environment, and does not affect the computer system and comes cuda cudnn. - Finally use the same method to install spyder
- To open any software, it is best to start from the prompt in a specific environment, such as
conda activate XXX spyder
- To install any software, use
conda install
orpip install
install it in a specific environment from the prompt (if there is no pip in this environment, you need to install pip with conda first). Note that both are only installed in the current virtual environment and not globally (Note: conda list can display all packages in this environment, including packages installed by pip install will also be displayed)
[Obsolete] Anaconda3+Tensorflow(1.12.0)+Cuda9.0+Cudnn7.3.1+Chinese package download and installation tutorial (Win10)
Anaconda
Use the old version: Anaconda3-4.3.0.1-Windows-x86_64
Download address (Mirror of Tsinghua Park):
https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
Installation note:
- Try to install to the root directory of a non-system disk
- Two installation options should be checked
- After the installation is over, do not tick the option to complete
MIRACLES
CUDA Toolkit 9.0 (Sept 2017)
download link :
https://developer.nvidia.com/cuda-toolkit-archive
note:
- From the desktop, right-click to open the Nvidia control panel to view the graphics card driver version. According to the table on the above webpage, determine whether CUDA 9.0 is compatible with the graphics card driver version, otherwise this tutorial is not applicable!
https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html
- CUDA may fail to install. Generally, CUDA installation fails because Visual Studio (VS) Intergration cannot be installed. Refer to the solution:
https://blog.csdn.net/zzpong/article/details/80282814
- After the installation is complete, open Nvidia Experience, if it prompts that the graphics card driver is not installed, it means that the requirements in 1. are not complied with! Otherwise, CUDA is installed successfully.
cuDNN
cuDNN v7.3.1 (Sept 28, 2018), for CUDA 9.0
download link :
https://developer.nvidia.com/rdp/cudnn-archive
Open the cudnn and cuda9.0 folders at the same time, as shown in the following figure: cudnn on the right, cuda on the left, copy the files in the bin on the right to the bin on the left, and copy the files in the include on the right to the include on the left , Copy the files in the lib on the right to the lib on the left, complete.
Tensorflow
Use 1.12.0 version: tensorflow_gpu-1.12.0-cp36-cp36m-win_amd64.whl
download address:
https://www.tensorflow.org/install/pip
https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-1.12.0-cp36-cp36m-win_amd64.whl
https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.12.0-cp36-cp36m-win_amd64.whl
These are the official website, GPU version, and CPU version.
Attach GitHub's previous Tensorflow whl file downloads:
https://github.com/fo40225/tensorflow-windows-wheel
installation method:
-
Run Anaconda Prompt
-
Installing third-party packages
pip install E:\tensorflow-1.12.0-cp36-cp36m-win_amd64.whl
At this time, Cache entry deserialization failed, entry ignored is normal. -
Enter the
pip uninstall protobuf
uninstall protobuf 3.7.1 -
Install the old version
pip install protobuf==3.6.0
Verify that the installation was successful
pip list
There should be a tensorflow (1.12.0) item.- enter
python
- Determine whether it is GPU or CPU mode:
- Enter the above code in Spyder, the output is the same.
- Spyder test code:
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import tensorflow as tf
hello = tf.constant("Hello!")
sess = tf.Session()
print(sess.run(hello))
operation result:
b'Hello!'
Anaconda Sinicization
Download the Chinese package and unzip it to any location other than the system disk
https://github.com/kingmo888/Spyder_Simplified_Chinese/archive/master.zip
In the folder, hold down shift and click the right mouse button, and "Open CMD window(s) here" or "Open Powershells(s) window here" will appear. Input: python .\main.py
select option 1 when finished , and input manually Path, enter the location of site-packages, such as:
D:\Anaconda3\Lib\site-packages
After pressing Enter, the installation is successful.
Open spyder and change the language to simplified Chinese in the preferences.
[Obsolete] TF1.10.0+cuda9.0+cudnn7.3.1 is executed under conda throughout
- Install Anaconda3-4.3.0.1-Windows-x86_64, the python version is 3.6, the version cannot be wrong;
- If you select all users during installation, all subsequent programs need to be run in administrator mode. Be careful!
- Double check the installation options;
- After the installation is complete, install cuda and cudnn according to the above tutorial;
- After installation
conda install tensorflow-gpu==1.10.0
, please wait patiently under prompt ;
- There may be a prompt that tensorflow 1.10.0 cannot be found in the current channel. If it appears, enter the command to search all channels, and enter the following commands to start the installation
anaconda search -t conda tensorflow
anaconda show anaconda/tensorflow-gpu
conda install --channel https://conda.anaconda.org/anaconda tensorflow-gpu==1.10.0
y
- Verify that the GPU is in effect:
import tensorflow as tf tf.test.gpu_device_name()
如果生效将显示:
'/device:GPU:0'
- Execute the following command (not required):