Setting Up CUDA, CUDNN, Keras, and TensorFlow on Windows 11 for GPU Deep Learning

Jeff Heaton · 174K views · 2022 · 22:19

Open on YouTube

Machine learning & deep learningTesting, debugging & developer toolstutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering questions about getting TensorFlow or Keras to see an NVIDIA GPU on Windows, especially the CUDA, CuDNN and environment variable steps.

Recommended by 2 people across 2 different months, 2022 to 2023.

What it is

A 22-minute screen-recorded walkthrough by Jeff Heaton of installing TensorFlow and Keras with GPU support on Windows 11. It covers the NVIDIA driver, Visual C++, CUDA, CuDNN, Anaconda/Miniconda, Jupyter, a dedicated environment and a kernel, ending with a test notebook. It uses pip rather than conda to get the latest TensorFlow.

What people said

Recommends 77 ChickenNug · 2023-08 · Stack Overflow · on “How to install tensorflow-gpu?”

New Solution (Command Line) Edit: It is now far easier to download Tensorflow with GPU support using the command line. I have kept the old solution below, but I'd recommend you use this new solution. For Windows, you'll need to use Conda from the command line. conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0 # Anything above 2.10 is not supported on the GPU on Windows Native python -m pip install "tensorflow<2.11" # Verify the installation: python -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))" For Linux, you can download using pip. python3 -m pip install 'tensorflow[and-cuda]' # Verify the installation: python3 -c "import tensorflow as tf; print(tf.confi

Recommends mirArnold · 2023-12 · Stack Overflow · on “Running Keras model on GPU”

I found the solution. Installing Conda is only the first step. After that CUDNN has to be placed on the hard drive and the environment variables have to be set up. I missed the latter. The following video describes to process better, than I could write it down: [this video]

Cites MagiCs ito · 2022-07 · Stack Overflow · on “I can't load an small AI model with nvidia 3090 in Windows (Cuda: Out Of Memory)”

I come here because i am having problems loading any size of model with a nvidia 3090 (24Gb ram) I just followed this video (and thousands more xD) and install everything that Jeffs said here: Jeffs instruction to install tensorflow, cuda, etc in windows [this video] Then I installed pytorch for cuda 11.6: pip3 install --pre torch torchvision torchaudio --extra-index-url [LINK] I have tensoflow 2.9.1 and cuda 11.5. When I load any model of microsoft/DialoGPT-* , the vram of the 3090 go directly to 24Gb so i go out of memory. The code in Colab its working correctly with 16 Gb of VRAM. I tried in windows without success so I installed Ubuntu today to check it and I have the same problem! Except one