Win10 system Anaconda GPU environment to build tensorflow

My environment: Win10 + Anaconda + tensorflow-gpu1.14 + CUDA10.0 + cuDNN7.6 + python3.6

Note: tensorflow version, CUDA version, cuDNN version and python version is one to one.

First, determine your needs and can be installed version

  1. Check your computer supports CUDA GPU environment and to build a version suitable

  Control Panel -> Device Manager -> Display adapters, check whether support native cuda gpu, graphics card to view the machine configuration, compared to the official website of the video card model supports

    Computing power required is greater than 3.1 https://developer.nvidia.com/cuda-gpus  ,

 

  Control Panel -> NVIDIA Control Panel -> System Information, you can find support for CUDA installed Version of https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html , (backward compatible) .

   2. Check the fit of the corresponding support CUDA version of python, tensorflow etc., https://www.tensorflow.org/install/source_windows

 (Anaconda has finished downloading)

Second, download CUDA10.0

Official website download site , a exe file is downloaded, double-click the installation, Visual Studio, Nsight are CUDA C IDE, if not, then you can not have both installed or choose to install it, he will prompt you to install Visual Studio. Graphics driver because we have viewed their own version of the driver, so it must be supported by the driver version too low will not happen, so you should choose not to install (I did choose to install, the results of the original version of the driver is falling 441.45, 411.31 now become).

 The back is next and then the installation was successful. Then enter cmd nvcc -V test installation was successful.

Third, the installation cuDNN

Note CUDA version and version cuDNN corresponding agreement, the official website to download (first mail registration and log it).

Download the complete decompression, and then include, bin, lib files in the file pieces are moved to include in the installation directory cuda, bin, lib inside.

Once configured, we can verify that the configuration is successful, the main use of the built-in CUDA deviceQuery.exe and bandwithTest.exe:
First win + R start cmd, cd to the installation directory  ...\extras\demo_suite, and then were executed bandwidthTest.exeanddeviceQuery.exe,两个结果都显示pass则证明成功。

 Fourth, download and install tensorflow1.14

( First built in the anaconda in the virtual environment , my tensorflow2.0 virtual environment has been configured online because of some classic code is tensorflow1.x environment, and some libraries tf2.x no longer supported, so this installation tensorflow1 .14)

Before installation can be the firstpython -m pip install --upgrade pip更新pip,否则可能提示pip版本过低。

pip install tensorflow-gpu==1.14.0 -i https://pypi.tuna.tsinghua.edu.cn/simple

With Tsinghua mirror source download, or download a timeout error prone.

Testing a successful installation of code:

import tensorflow as tf

gpu_ok = tf.test.is_gpu_available()
print("tf version:", tf.__version__)
print("use GPU", gpu_ok)

Instead of manually adding the path path (CUDA when I changed the name of the file that caused the error, and it automatically adds the normal path Well, if error, you can then check if a path has been added).

tensorflow1.14 the gpu environment to build complete!

Guess you like

Origin www.cnblogs.com/Cloud-king/p/12538515.html