First of all,
Suppose you use these
- Python3
https://www.python.org/downloads/ - Anaconda
https://docs.anaconda.com/anaconda/install/ - CUDA
https://developer.nvidia.com/cuda-downloads - cuDNN
https://developer.nvidia.com/rdp/cudnn-download - TensorFlow
https://www.tensorflow.org/install
※Precautions
- If you use other tools, please refer to our other articles
- Articles on how to build an environment for Python3 and Anaconda are abundant and will be omitted.
- You will be asked to register as an NVIDIA user in the middle of building the environment, but it is free, so please register
CUDA
1. Open the CUDA download screen
2. Download the installer
Select the following
Windows
↓
x86_64
↓Your WindowsOS version
↓
exe
(local)
3. Install
Select the installer downloaded in Explorer and install
* You will be asked various questions at the time of installation, but Yes man is fine.
cuDNN
1. Open the cuDNN download screen
2. Download the installer
Check on Agree
Select Local Installer for Windows (Zip) to download
the installer with a note on the version
3. Unzip the ZIP file
4. Move the installed cuDNN files to CUDA and install them
Launch File Explorer
Open the CUDA folderC:Program FilesNVIDIA GPU Computing ToolkitCUDA<Version>
Open the cuDNN folder
Move the contents of bin, include, and lib of cuDNN respectively to
the contents of bin
,
include
, libx64
of CUDA, respectively
The contents of each bin
, include, and lib
of cuDNN are emptied and
each bin
of CUDA
, each
bin of cuDNN is included in the contents of
include, libx64
, The state in which the contents of
the lib
are contained
C:Program FilesNVIDIA GPU Computing ToolkitCUDA<Version>bin C:Program FilesNVIDIA GPU Computing ToolkitCUDA
<Version>include
C:Program FilesNVIDIA GPU Computing ToolkitCUDA<Version>libx64
TensorFlow
1. Launch Anaconda Navigator
2. Select Environments
3. Click Create
in the bottom left
4. Build a virtual environment for TensorFlow
* We will make both CPU version and GPU version.
For CPU version
Enter tf-cpu
in Name and create
GPU version
Enter tf-gpu
in Name and create
5. Install TensorFlow in each environment
* Install both CPU and GPU versions.
For CPU version
Select the created environment tf-cpu
and press
Open terminal ↓
$ pip install tensorflow
↓
Confirm. If it looks like this, it is a success
$ python
↓
>>
↓
>> import tensorflow
↓
>>
GPU version
Select the created environment tf-gpu
and press
Open terminal ↓
$ pip install tensorflow-gpu
↓
Confirm. If it looks like this, it is a success
$ python
↓
>>
↓
>> import tensorflow
↓
>>
This concludes the construction of the environment.