GPU installed on windows minimalist version AI framework (tensorflow)

GPU installed on windows minimalist version of AI framework

If we want to install GPU version of the AI ​​framework on windows system, such as GPU version of tesnorflow, we would usually see something like the following installation tutorial

The official version

  1. Installation CUDA
  2. Installation cuDNN
  3. Configuration environment variable
  4. Install python environment
  5. Gpu installed version of tensorflow Development Kit

Ye looks like is not very complicated, but more to the pit where you suspect life.

  • Download cuDNN time required to register, but also because cuDNN files outside the network, the download speed is very slow.
  • For example, different versions of tensorflow and CUDA (cuDNN) version is matching relationship, you might say I'm their good will check the dependencies, and then find a good install the appropriate version.
  • For systems such as windows, graphics driver version that you can determine the CUDA version installed, there will ignore this part of the tutorial.
  • ...
    If you are lucky enough to put above all these pits wading, you may also encounter a problem, that is, if you use pip to install tensorflow-gpu, or is likely to report a variety of magical errors. In fact, on a frame mounted AI windows system, the best method is to use Conda, rather than native pip.
    Summarizes the common issues above, let's start describes how to install GPU minimalist version AI framework on windows:

Minimalist version

  1. Anaconda installation
  2. New conda virtual environment (recommended python3.6, interchangeable domestic source)
  3. Install the graphics driver (official website to download or drive assistant software)
  4. Cudatoolkit installation package installed AI frame
  5. End it

Above we can see, here we use a package called cudatoolkit, equivalent to a virtual environment in which conda automatically installed CUDA. Most of the time cudatoolkit in CUDA and cuDNN are installed together, which eliminates a lot of trouble, such as AI version of CUDA framework and the corresponding issues and manually set the environment variable, and so on.

Specific installation script can refer to the following commands:

Installation tensorflow

conda create -n py36 python = 3.6

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes

conda install cudatoolkit tensorflow-gpu

Installation pytorch

conda create -n py36 python = 3.6

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch

He published 183 original articles · won praise 79 · views 340 000 +

Guess you like

Origin blog.csdn.net/dlhlSC/article/details/104716883