Anaconda3+Tensorflow(1.12.0)+Cuda9.0+Cudnn7.3.1 Chinese package download and installation tutorial (Win10)

[Latest method] 2020.9.13

  1. Install the latest driver version that the graphics card can install (CUDA and CUDNN do not matter)
  2. 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
  3. conda create -n XXXCreate a new virtual environment under Powershell
  4. In the new environment with conda install tensorflow-gpu=XXXspecific 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.
  5. Finally use the same method to install spyder
  6. To open any software, it is best to start from the prompt in a specific environment, such as
    conda activate XXX
    spyder
    
  7. To install any software, use conda installor pip installinstall 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:

  1. Try to install to the root directory of a non-system disk
  2. Two installation options should be checked
  3. 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:

  1. 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

  1. 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

  1. 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.
Insert picture description here

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:

  1. Run Anaconda Prompt

  2. 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.Insert picture description here

  3. Enter the pip uninstall protobufuninstall protobuf 3.7.1

  4. Install the old version pip install protobuf==3.6.0
    Insert picture description here

Verify that the installation was successful

  1. pip listThere should be a tensorflow (1.12.0) item.
  2. enterpython
  3. Determine whether it is GPU or CPU mode:Insert picture description here
  4. Enter the above code in Spyder, the output is the same.
  5. 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.
Insert picture description here
Open spyder and change the language to simplified Chinese in the preferences.
Insert picture description here

[Obsolete] TF1.10.0+cuda9.0+cudnn7.3.1 is executed under conda throughout

  1. Install Anaconda3-4.3.0.1-Windows-x86_64, the python version is 3.6, the version cannot be wrong;
  2. If you select all users during installation, all subsequent programs need to be run in administrator mode. Be careful!
  3. Double check the installation options;
  4. After the installation is complete, install cuda and cudnn according to the above tutorial;
  5. After installation conda install tensorflow-gpu==1.10.0, please wait patiently under prompt ;
    Insert picture description here
  6. 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

  1. Verify that the GPU is in effect:
import tensorflow as tf
tf.test.gpu_device_name()
如果生效将显示:

'/device:GPU:0'

  1. Execute the following command (not required):
    Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_43713224/article/details/89338518