217 - 9 steps to installing TensorFlow GPU on Windows 10
HTML-код
- Опубликовано: 11 май 2021
- Step 1: Install Visual Studio community edition: I installed VS2019
visualstudio.microsoft.com/vs...
Step 2: Install your IDE if you haven't already done so. I installed Spyder 4.1.5 via Anaconda individual edition.
www.anaconda.com/products/ind...
Step 3: Setup a separate environment for your IDE. I created an env. with python 3.7
I skipped 3.8 as it is relatively new and some of my libraries may not be tested or available.
On Anaconda you can use Anaconda Navigaor to create a new environment.
If you only see 3.8 as option on Navigator you can create new env from anaconda prompt:
conda create -n py37gpu python=3.7 anaconda
For the following steps verify instructions from www.tensorflow.org/install/gpu
Step 4: Verify your GPU is actually supported for deep learning:
developer.nvidia.com/cuda-gpus
Step 5: Figure out your GPU model: I have P5000 Quadro
and Update the GPU driver: For me it updated to Version 461.72
www.nvidia.com/download/index...
Step 6: Download and install CUDA Toolkit. I installed Version 11.0
developer.nvidia.com/cuda-too...
Step 7: Download cuDNN. I downloaded version 8.0.4
You need to sign up for Nvidia developer program (free)
Extract all folder contents from cudnn you just downloaded to
C:\program files\Nvidia GPU computing toolkit\CUDA\v11.0
Step 8: Install tensorflow
Open spyder in the new environment that got named as: py37gpu (or whatever name you assigned)
- pip install tensorflow
Step 9: Verify the installation
Create a new python file and run these lines to test if GPU is recognized by tensorflow.
import tensorflow as tf
tf.test.is_gpu_available(
cuda_only=False, min_cuda_compute_capability=None
)
The last few lines of my output shows...
physical GPU (device: 0, name: Quadro P5000, pci bus id: 0000:03:00.0, compute capability: 6.1)
physical GPU (device: 1, name: Quadro P5000, pci bus id: 0000:a1:00.0, compute capability: 6.1)
I have 2 GPUs.
But on Windows you will not be able to efficiently use both GPUs for training.
#On windows sysems you cannot install NCCL that is required for multi GPU
#So we need to follow Heirarchial copy method or reduce to single GPU.
strategy = tf.distribute.MirroredStrategy(devices=devices_names[:n_gpus],
cross_device_ops=tf.distribute.HierarchicalCopyAllReduce())
#The following will raise an error on Windows about NCCL.
#strategy = tf.distribute.MirroredStrategy(devices=devices_names[:n_gpus]) Наука
You're such a saviour. I was trying this with a thousand different tutorials. This is the only one that actually worked. Thank you very much!!!
Thank you for this video! I really needed and updated way to do this because I've been struggling with doing this for a while and this was the most updated version I found
Thanks very much for this insightful lecture, it was very helpful. You're the best!
Thank you for the video!!! It really helps me a lot!!!!
I could see this tutorial coming up from you......Could smell it........Getting to a secure environment and dependencies and running the GPU is a real mess for a newbie.......I had close to 5 different environments in Anaconda, and always had some conflicts......I will sure follow the steps given by you.......Excellent show and tell and live demo from the start to the stage of testing successful TF installation......Pranamas Ajarn......
Thank you very much Mr. Kannan.
Ajarn......Perfect.......I removed all the earlier Tensorflow Conda environments......Just followed your steps, one-by-one........Worked like a cool breeze and charm........Both TF and NVIDIA web pages, have too many links, and a newbie like me, end up clicking, downloading and installing the wrong versions......For the first time, got it correct, without any bugs.....Now, it if for me to protect the environment and use it prudently.....
Excellent!!! I went through a bit of a learning curve while getting my first system ready. The second time worked like a charm.
Thanks for the very detailed guide!
Glad it was helpful!
permission to learn sir. thank you
thanks for the video, was stuck trying to run tensorflow gpu on anaconda the other week(it utilized cpu but not gpu), turns out it was because i didn't make a new environment and that somehow messed things up.
other thing is "conda install tensorflow" tends to mess things up apparently, so sticking with pip install (like in the video) is a good idea.
The process can be tricky. New environment gives you a blank slate that minimizes any issues. I am glad you got it working.
I wish you could've discussed the advantages of installing GPU into an Operation System! Thank you for your effort and hope you keep safe and healthy.
This Session Helps me alot, past few days ago i busted my TF Environment🎇🎇🎇.
Wonderful!
Thanks for this helpful video. But i have a problem
I followed all steps, and tensor flow already detected a GPU.
But when I run a training, I monitored the utilization of Both CPU and GPU. I found the CPU utilization is getting higher and GPU is still the same.
This means the training the done on CPU.
Any advice please?
Hey Sir, thanks! I would like to know which version of Anaconda you were used for this video? Mine is conda 4.10.1. Also, I have Visual Studio 2015 (community edition) installed, do I need to upgrade to the version 2019? Thanks again.
My Conda version was 4.9.2 and Spyder version was 4.1.5. I am not sure about VS2015 version, it may work as most of the dependencies and requirements seem to be for the graphics card and TensorFlow.
Hello Sir, Thanks for making this video for Windows system. Would you mind do a video of Ubuntu20.04 when you can? So many current tutorials are just not correct.
Thanks Sreeni for making this. Can you make one video about spinning a docker container which can encapsulate all the popular deep learning or machine learning tools at one place like numpy,pandas,matplotlib, scikit-learn, tensorflow-2, pytorch.
I have often found myself ruining my system someway or other when updates or changes happen with these tools and am confused how to make a docker container which separates all these tools from OS/system components.
Thanks
I did a few videos on Docker in the past. Please check videos around number 80, 81... Here is the direct to one of the videos that you may find useful. ruclips.net/video/8uaDoMuDK6E/видео.html
Nice Video, Thanks for that, Can you show how to install lightgbm-gpu, it has several steps that are confusing, Thanks
I have an error when install NVIDIA CUDA : 'The flowing processes must be stopped before the CUDA Visual studio integration installation can proceed Performance Monitor(Process ID : 7788)' .How to fix it, sir. Thanks
I am getting started with using GPU for deep learning, but i am facing problems in setting up the GPU, can you help me with that. Any helpful video link will work. thanking in anticipation.
Thank you sir
Welcome
Hey nice Tutorial I must use TensorFlow 1 (using model from there). Can I follow your steps with the specific version of cuda and cudnn?
These steps will work in general. You need to make sure you pick the right CUDA, Drivers, and CUDNN for your GPU.
Hello, I need to install tensorflow-gpu 1.8 for a project. I have a Geforce GTX 1650ti graphics card. Can you show me a way to do this?
error is showing like this:
cannot import name 'LayerNormalization' from 'tensorflow.python.keras.layers.normalization' (D:\anaconda3\lib\site-packages\tensorflow\python\keras\layers
ormalization\__init__.py)
what if RTX 3080 TI, and RTX 3050 Laptop GPU ? its not on the list, so it does not have GPU??
After doing all the steps according to the latest version nothing worked for me, but the fun fact is my gpu is fully supported and computation score is 8.6 but still I cannot use it because it needs windows subsystem for Linux, and this is the most heated thing to me.
Thanks for the video. I did exactly all steps but in step 9 I did not get any output(even error), so I'm not sure that my TensorFlow works on the GPU or not, thank you for your help.
I have the same problem, did you solve it?
this is March 5th 2022, I downloaded TF 2.8 with cudNN 11.6 with PyCharm on Python 3.10 and faced a:
.197052: I tensorflow/stream_executor/cuda/cuda_dnn.cc:368] Loaded cuDNN version 8204.
For context, I was able before to train models normally (without GPU acceleration).
But after trying to install 11.6, PyCharm executes code normally (before training), and then it prints the above warning, and then "
Epoch 1/10" where I have 10 epochs, then it exits console.
Anyone facing this issue, I downloaded cudNN 11.4 instead and everything seems find as far as I can see.
Using tf.distribute.HierarchicalCopyAllReduce() instead of nccl is rather slowing down my training.
Should I move to Linux just for nccl?
Is there any other way? plz, help!!
As far as I know NCCL is not supported on Windows yet. So if you want to benefit from multi GPU you may want to work on a Linux system. Not just a Linux subsystem on Windows, an actual Linux operating system.
@@DigitalSreeni thanx a lot.
Do we not need to update the environment variables as well
Not really, if you work with Spyder. If you want to run code from the command line you will have to activate the right environment.
Thank you ok ok
This works with CUDA 11.2, cuDNN 8.1.0 @ Dec 07 2021
Thanks Rohit. This video provides a framework to install TF with GPU support. The exact CUDA, cuDNN, and other versions will depend on other factors such as the exact hardware configuration and software package versions.
@@DigitalSreeni Yes, I followed the instructions in your video and followed the package versions specified on the Tensorflow website.
My tf still shows only cpu
Ati no work? :(
Sir, any idea about this error "ds tensor not initialised"
No, never encountered. May be related to out of memory issues but have no personal experience to offer advice.
Ok sir
tensorflow 2.11 stops supporting gpu on windwos native system. it is so sad.
I think you can use the WSL2 way. This has been the case for Docker and now TF is following. In any case, for serious work I recommend Linux anyway.
@@DigitalSreeni Thanks so much. and your lectures on youtube really helps me a lot. thanks again.