After initializing the computer, I had to re-install various things to run tensorflow with gpu. Then I stumbled on various things, so make a note to put it back in the future.
windows10 RTX2070 Ryzen 3700x Anaconda
Download Anaconda Creating an environment Understanding tensorflow dependencies download cuda Download cuDNN path
It seems that the writing style has changed considerably from 1.x to 2.x in 2019. Therefore, it seems that some programs on the net do not work. Therefore, create two environments, one with the latest version of 2.x and the other with the latest version of 1.x.
2.x
Python3.7 tensorflow-gpu==2.4.0 cudnn8.0.5 cuda11.0 keras-2.4.3
https://qiita.com/ozaki_physics/items/985188feb92570e5b82d There is a way to create an environment.
Conda create -n 37tens24 python=3.7 anaconda
Next, grasp the dependency environment of tensorflow https://www.tensorflow.org/install/source_windows?hl=ja Because there was no latest version, and sometimes it was wrong
https://www.kkaneko.jp/tools/win/keras.html
I confirmed here Also, basically you can follow this site In the latest version, keras seems to have no dependency
pip install tensorflow-gpu==2.4.0
pip install keras
cuda toolkit
https://developer.nvidia.com/cuda-toolkit-archive Download from here
Download 11.0 It is better to download the local one in consideration of starting over (about 500MB)
Run Download everything at first
https://www.kkaneko.jp/tools/win/cuda.html Here is detailed
cudnn
Detailed explanation https://www.kkaneko.jp/tools/win/cudnn805.html
https://developer.nvidia.com/cudnn Download from here And defrost
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0 Think about trying again, back up this, and then copy and paste the decompressed contents
___ System ___ environment variable name CUDNN_PATH value C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0 Set like (from administrator)
Note that you need to open it as an administrator to change system environment variables.
https://www.lisz-works.com/entry/sys-env-admin
Administrator powershell from right click on Windows mark
Start C:\Windows\system32\rundll32.exe sysdm.cpl, EditEnvironmentVariables
Now you can use everything.
1.x
37tens115 tensorflow_gpu-1.15.0 It doesn't work with Cudnn 7.4.2, so 7.6.5 Cuda10.0 Keras2.3.1 The latest version of Keras doesn't work with TensorFlow 1.15. Install Keras version 2.3.1
For the second and older version, cuda This is all you need
This site is detailed https://www.kkaneko.jp/tools/win/cuda.html
Cudnn_path stayed at 11 and worked
It doesn't go smoothly and it's difficult, so please do your best.
Recommended Posts