Suddenly I wanted to make an image discrimination application, so first I used jupyter in the Window environment I tried to make a program that easily distinguishes images.
Development environment OS: Windows10 Home GPU: Geforce GTX1660Ti Anaconda: 4.8.2
First, download and install Anaconda from the following site https://www.anaconda.com/products/individual
Next, we will introduce TensorFlow, which is a library required for image recognition.
Before that, since the PC I'm using now has a GPU, I'd like to use the GPU for calculation. However, it seems that you need to install the Nvidia driver, CUDA and cuDNN, and these tools are not always up to date and the GPU will not recognize you unless you are careful about the version ...
So, first of all, search for your GPU from the following site and download and install the Nvidia driver https://www.nvidia.co.jp/Download/index.aspx?lang=jp I'm not sure about the download type, but I chose the Game Ready driver. It was version 445.87 when I installed it.
As I wrote earlier, it is necessary to install while paying attention to the correspondence of each version, so see the correspondence table on this site Nvidia driver version ⇒ Install the corresponding CUDA ⇒ Download the corresponding cuDNN Page with correspondence table https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html https://www.tensorflow.org/install/source_windows download page CUDA: https://developer.nvidia.com/cuda-downloads cuDNN: https://developer.nvidia.com/cudnn-download-survey In my case, the CUDA version was 10.0.130 and the cuDNN was 7.4.2 for CUDA 10.0.
After installation, do the following: -All the data in the downloaded cudnn folder Copy to C: \ Program Files \ NVIDIA GPU Computing Toolkit \ CUDA \ v10.0
・ In system environment variables Variable name: CUDNN_PATH Value: "C: \ Program Files \ NVIDIA GPU Computing Toolkit \ CUDA \ v10.0" Is newly added
Now that the necessary installation on the GPU side is complete, install the TensorFlow library at the end. First, create a separate environment for TensorFlow on Anaconda.
conda create -n tf37 python=3.7 anaconda
conda activate tf37
In that environment Install tensorflow
conda install tensorflow-gpu==2.0.0
Finally, run the command on python and check that the GPU is recognized properly.
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())
This completes various installations and you can use TensorFlow.
At first, I used pip to install by relying on other articles, but when I used tensorflow, I got the following error. Probably, when using it with jupyter etc., it seems to be useless unless it is installed with conda.
Recommended Posts