Install Tensorflow/Keras in WSL2 for Windows with NVIDIA GPU

preview_player
Показать описание
Welcome to this tutorial on how to install TensorFlow/Keras for use with a GPU on Windows! In this video, we will guide you through the process of setting up TensorFlow/Keras to utilize the power of your GPU, specifically an NVIDIA RTX 6000 (Ada).

Before we get started, it's important to note that the current versions of TensorFlow can only be installed using Windows Subsystem for Linux 2 (WSL2). So, if you haven't already installed WSL2, we will show you how to do that as well.

Once you have WSL2 set up, we will guide you through the steps of installing the necessary drivers, setting up your environment variables, and installing TensorFlow/Keras with GPU support. We'll also show you how to verify that everything is working correctly.

As mentioned earlier, we'll be using an NVIDIA RTX 6000 (Ada) for this tutorial, which was kindly provided by NVIDIA. However, the steps we cover should be applicable to other NVIDIA GPUs as well.

By the end of this tutorial, you'll have a fully functioning installation of TensorFlow/Keras with GPU support on your Windows machine, ready to take on your machine learning tasks with lightning-fast performance.

So, grab a cup of coffee and join us as we dive into the world of TensorFlow/Keras with GPU support on Windows!

TensorFlow Install Docs

NVIDIA RTX 6000 Ada

NVIDIA Driver

0:19 State of Windows TensorFlow in 2023
1:34 NVIDIA Driver
3:00 Install WSL2
3:31 Install Miniconda (Python)
4:42 Create Virtual Environment
5:27 Check GPU
5:37 Install CUDA
6:46 System Path
7:32 Install Tensorflow
8:19 Verify Install
Рекомендации по теме
Комментарии
Автор

2024, and this video is still relevant!
The installation instructions at tensorflow website have changed, and I couldn't get any GPU support to work with them. The "old" command flow listed in this video still works just fine!
One note: after following your instructions, I had to downgrade Tensorflow to version 2.10.
With 2.11 it would install and could be loaded correctly, but then it would crash when trying to train or run a model.

tjkeranen
Автор

Your work on this subject and this simplified tutorial for installing CUDA and Tensorflow is highly appreciated Professor. Thank you

aneeshkalita
Автор

Jeff, I cannot thank you enough. You've not only shown us the entire installation process but also explained it. Thanks a lot!

danielmacedo
Автор

Hi Dr. Heaton. I was watching your videos last year and messed around with TensorFlow on my own. I just finished up an MSCS bridge program and am now in an AI program. Thanks for getting me on this path.

ryanprasad
Автор

As others have said, perfect video. Interesting thing of note - I found your video by giving GPT4 with VoxScript the following prompt:
I want to learn more about creating a lstm in pycharm inside wsl2 to have tensorflow use my gpu. Please find a list of no more than 10 youtube videos that will expand my knowledge to an expert's level on these topics.
Your video was the number one result. This wasn't the entire chat history but I found it interesting regardless!

asmitz
Автор

Jeff! Thank you so much for the information. It's so much better than rifling through the docs and GitHub issues. Subscribed!

milesperhour
Автор

PERFECT!
JUST DONE!
This is the best procedure that i've found on internet.
Remarks: the TF web page now has new instruction for the GPU set-up section. I used these new ones and all goes well (10/04/2023).
Thank you Jeff.

marcominoia
Автор

The best of the videos I've seen! Thank you!

bdouglas
Автор

Oh gooosh. It has just solved the crazy problem I was dealing with. Thank you 👍👍👍

hamidddshekoohiii
Автор

Thank you so much, man! It worked with a few tweaks. I used the newest versions of cuda and tf, it worked fine!

TheNokoma
Автор

Great, thanks for this. May 21, current versions give Python 3.10 and TF 2.12, and a 4090 shows up fine after install; reboot wasn't required and followed the TF notes verbatim. Whether running models will work that I built and have been using for a couple of years with early TF2 and a 1070 will be another matter! Also created a .wslconfig in the Windows home dir to increase RAM from the default of 50% physical with:
[wsl2]
memory=56GB
processors=8
swap=16GB

makers_lab
Автор

Bro I freaking love you!! Thank you!

As a tip for everyone trying to install this with gpu support, stick to the versions he's using in the video. I followed the steps but used the version in the TF instructions and it failed.

michaelmurillo
Автор

Hi Jeff, thank you very much for this video. You too all the guess work out of the process which, for me is the path of least resistance 🙂

kenchang
Автор

Fantastic video. clearly explains everything that you need to know.

Noir_SD
Автор

This really helped me. Thanks a lot Dr. Heaton

zeuztrumpeter
Автор

This is a brillant demonstration. Thank you.

briankoech
Автор

Thank you very much !!

I love your detailed explanations.

Eran

eranfeit
Автор

Thanks for the new tutorial! Been struggling for the last 3 weeks to have tensorflow detect my laptop's dedicated gpu. It only sees my integrated gpu. I've gone through many forums, web searches etcc.. and I've tried at least 5 different tutorials including your old ones without success. I'll try this one tonight. God, I hope it works because this is driving me nuts and it's become an obsession of mine to get it to work 😅

Malleyka
Автор

It's very helpful guide!
Thanks very much 😉

VladislavSoren
Автор

Thanks man this was a good video. Nothing as frustrating as installing Tensorflow on windows.

jacobusstrydom