After successfully installing Anaconda 3, open your anaconda prompt, you will see the (base) appears at the beginning of your path. The anaconda version I installed is Anaconda3 -2019.10-Windows-X86_64.exe 461.5M.
tensorflow-gpu-1.15.0
python 3.5–3.7
cuDNN 7.4
CUDA 10
It’s really important that all the versions are compatible. If you are using PyTorch, note that PyTorch requires CUDA 10.2
at least, and CUDA 10.2
works against TensorFlow-1.15.0
. You might want to install multiple CUDA versions or switch to tensorflow 2.x.
All the compatible versions can be found here: https://www.tensorflow.org/install/source_windows
Make sure you check first!!
1. Create a new conda environment.
conda create --name my_gpu python=3.7
2. Activate your environment.
activate my_gpu
or
source activate my_gpu
Starting now, all the packages you installed can only be found within this conda environment.
3. Install GPU version of TensorFlow
conda install tensorflow-gpu
or
conda install tensorflow-gpu=1.12
if you want a specific version (but make sure to change your CUDA
/cuDNN
versions if needed!)
4. Install Jupyter notebook and register the conda environment in the kernel.
python -m ipykernel install --user --name my_gpu --display-name “python3.7 my_gpu”
5. Launch jupyter notebook
jupyter-notebook
6. Test it out
click new and select the kernel you just registered. In the new notebook, run import tensorflow as tf
This is by far the best and simplest method I found. Let me know in the comment if there is any issue you encountered! Happy ML :)