How To Use Your GPU for Machine Learning on Windows with Jupyter Notebook and Tensorflow
HTML-код
- Опубликовано: 24 сен 2024
- A quick guide on how to enable the use of your GPU for machine learning with Jupyter Notebook, Tensorflow, Keras on the Windows operating system.
I researched and tried various methods to get this work, and discovered this to be the easiest and quickest solution.
This will allow you to use your GPU instead of your CPU when training your your neural network.
This makes it so that iteration through each epoch of your datasets will be completed faster.
Heres a copy of the test functions:
import tensorflow as tf
from tensorflow import keras
print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices('GPU')))
tf.test.is_built_with_cuda()
print(tf.version.VERSION)
import sys
sys.version
Please Like, Comment, and Subscibe so I will make more videos.
after suffering for more than a week to make tensorflow integrate with GPU, finally, you saved me. Thanks,
Thanks mate, making a model for my thesis and was wondering why Jupyter was using my CPU instead of GPU for training the model. This was such a big help!
Glad I could help!
Oh my lord, thank you so much, i tried for 3 days to have my notebooks running on GPU, at the end i found you and your tutorial saved me. Thx from Italy!
Thanks God U are here on RUclips Otherwise i was Failed in ML PROJECT ❤️❤️❤️❤️
Thank you. I was pulling my hair out with Ubuntu and windows. Fiddling with Python 3.8, CUDA liberties and dockers. This works right off the bat.
It helped a lot. Thank You. This is easier than doing it on anaconda prompt.
I didn’t know Intel had support for CUDA. Thank you.
For me, Anaconda taking lot of time while installing the packages mentioned like tensorflow, tensorflow gpu and keras. Is its supposed to take a lot of time or having any issue?
same "problem" here, how long did it take?
hi, happened to me too.
how i resolved this was i typed in this into cmd :
conda activate tf # tf is your environment name , activate the environment using this command
pip install tensorflow # installs tensorflow into ur envi
pip install keras
pip install tensorflow-gpu
hope it helps :)
@@jolenechng3900 LOL i literally did the same thing then i saw your comment
My man, you are amazing!
The pakages that are not installed do not show up. i do not understand why. please help, like if i search for "tensorflow " for the not-installed packages nothing shows up
Not working for me..It's showing no. of gpus as 0 only
Same here did u get an answer to that?
Make sure you are doing this on a PC with a Nvidia graphics card. I was using a 1080TI with my example.
As far as I know you have to install the cuda driver on your machine, which is provided by Nvidia. You have to register an account for that (I think it is free of charge). If you get the installation correct you can use your gpu.
Very helpful video. Made it very easy to start utilizing my GPU.
Thanks A lot, it saved lot of time
Hi, I followed each and every step, but the results I got after run the block of codes above is:
'''
Num GPUs Available: 0
2.10.0
'3.9.15 (main, Nov 4 2022, 16:35:55) [MSC v.1916 64 bit (AMD64)]'
'''
Could you please show me why this method doesn't work for me.
i am using NVIDIA GPU RTX 3060
Try using a different version of python.
Did changing the Python version work? I am currently having this issue as well.
Thanks a lot bro u solved my problem , I was unable to run my deep learning models
Hey! thanks for this helpful tutorial.. however I have few ambiguities to ask:
1. I have already installed jupyter notebook in my system. Do I have to uninstall it and after configurating the environment, install again?
2. Won't it be problematic for our system if we enable GPU as default? If yes, Is there any option to turn on GPU for specific notebooks only?
Thank you in advance for your help!
Hi! I've done it and I get 1 avaibale GPU. But do I need to install CUDA and CUDNN? (I have an Nvidia GPU)
I am currently connected to a remote GPU, what would be the equivalent code for that?
It does not work with my laptop. The tensorflow-gpu library does not download, Conda stays loading for hours to download just that library.
Its recommended to do this on a PC with a Window OS.
@@minTwin I have Windows OS
I have NVIDIA genforce 940mx. I tried in both windows10 and ubuntu but it's not working. It's showing no. of gpus as 0 only. Can you help me out?
same problem ?
+1
Its been stuck at the installing packages for a while. How could I solve this issue?
me too, I'm stuck at "solving package specifications"
Thank you so much for this tutorial, I ran into some errors but it worked after struggling through it a bit!
Great to hear!
Why I don`t have this list on 01:07 ? It`s a blank page in my case
It show DLL problems. And not working in i7 12gen RTX 3050.
I followed this, I could not get it to work.
Music: disruptive
Does this method work for Intel Iris Xe Integrated Graphics? I have an 11th gen core i5-1135G7. I don't have a dedicated graphics card and I was hoping if the integrated graphics could be used.
Did you find how to do it as I’m on the same shoes as you?
@@imaanemidouune5419 It doesn't work. It remains stuck on 'solving package specifications'. I tried doing it through command prompt too but it didn't work either. I later learnt that we need an NVIDIA GPU for that. I referred to Intel Analytics Toolkit too but it's not supported for the Iris XE Graphics. If you still find a way to get it done somehow, though, please do share, because Google Colab is quite slow, haha!
Same here
Thanks finally done
thanks dear . you tutorial work for 3080 nvidia gpu?
Thanks for this video man
if it shows 1 gpu does it mean now i am using gpu? do i need to activate it with a code command and how to know that i am currently using gpu ?
Does this work with Scikit learn library?
It worked. Thanks
what about CUDA if you have nvidia gpu?
what about radeon gpus
It's that KOF 96 theme in the background?
Yes
i have 3060 installed in my pc, but the returns 0 as no of gpus
Is it works on amd gpu? I have rx570
thanks a lot man!
gpu available showing : 0 what to do pls tell
what about CPU ?
cudnn ?? cuda toolkit??
why do I not get the tensor flow options
did you find any solutions?
@@dhruvil8 no i just jump into a terminal and install it myself
nice video . From vietnam
question! if my python is 3.11, do I still have to make it 3.6 on "Create new environment"?
I'm trying to do it with 3.6 and it does not load. Also having trouble with 3.11 xd
Awesome video! The music was too loud and interruptive though
Thanks!
Thanks a lot
Thank you sooo much
Mine says 0 after running the gpu test :+{ Am I supposed to manually install a new ipykernel for this?
got it working already! thanks :+}
@@chummicrisologo2474 How did you manage to solve it? It stills returns 0 for me
@@yassineaderkaoui3598 Oh hey! I used both the anaconda navigator and the conda prompt!
Here are the steps I took:
1. Followed this video up to the point of creating the new environment and installing the tensorflow library, tensorflow gpu, etc. through the Anaconda Navigator.
2. Still using the Anaconda Navigator, I uninstalled ipykernel (which is automatically installed when creating new environments through the navigator) for that new environment.
3. Opened Conda Prompt and switched to the newly created environment. You can do this by inputting conda activate environment_name. You can verify that you are on the new environment by typing conda env list and checking if the asterisk in the output is on the name of the new environment you made.
4. Reinstalled a kernel on the environment . This was done by first pip installing ipykernel by typing pip install ipykernel. Once the download has finished, you can install the kernel on the environment through this command: python -m ipykernel --user --name environment_name --display-name "environment_name"
5. After that, I installed jupyter in the environment through this command: conda install jupyter
6. You may then type jupyter notebook in the same prompt to launch jupyter notebook using that new environment. Open up a new notebook and try the test code as shown in this video. At that point, mine would already show 1 and confirmed to be working by monitoring my gpu usage on Windows 10 while training a deep neural net.
@@chummicrisologo2474 Thanks! it worked for me too but I had to download CUDA toolkit and CUDNN into my Nvidea GPU file to detect the GPU.
Great thanks again!
@@yassineaderkaoui3598 sure thang brother
After creating environment and installing all the library it's showing available GPU 0
Did you try using Jupyter Notebook?
Is it mandatory to use python 3.6 version? is it fine to go with 3.8 or 3.9?
I think using newer versions of python is fine.
It says tensorflow-gpu is removed now
does this work with pytorch?
mass bro nee
Does it work with AMD ??
i did this but it still say false
So you do not need cuda toolkit installed at all?
i had the same doubt !
Anyone know how to resolve this error please give me suggestions
what about VS CODE PLEASE TELL MY VS CODE USING CPU
You are an angel from the Heaven
do i need to install cuda and cunn before?
Yes
when you create an environment and install tensorflow-gpu it installs CUDA toolkit and cuDNN with it, it didn't work for me in the first try but I tried again and it worked!
PLEASE, fix your tutorial
bro how much time adding packages will take?
Downloading packages can be very quick depending on your PC's build.
Thanks a lot , but please remove the music
I have gtx 10505ti 4gb VRAM
I did everything as you described, but still it is saying
import tensorflow as tf
print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices('GPU')))
Num GPUs Available: 0
tf.test.is_built_with_cuda()
True
tf.version.VERSION
'2.1.0'
sys.version
import sys
sys.version
'3.6.13 |Anaconda, Inc.| (default, Mar 16 2021, 11:37:27) [MSC v.1916 64 bit (AMD64)]'
Please advise.
thanks
why does installing jupyter lab on new environment takes more than 2 hours [yet still not finish]?
Probably need to upgrade your hardware such as your CPU and RAM.
@@minTwin its intel i7 core 11th generation with 16gb RAM. i dont think its the problem. Its solved by other tutorial video
bro i have the same problem, did you find the solution ? Or did you find another method ? Please respond, i will be very grateful
thanks a lot ! It's working for me :)
can it work with Intel Integrated gpu 620? please reply
Ddoes this work on mac??
Different approach is required on Mac.
is there any alternative for anaconda
u deleting comments
Num GPUs Available: 0
bgm is good
import tensorflow as tf
from tensorflow import keras
print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices('GPU')))
tf.test.is_built_with_cuda()
print(tf.version.VERSION)
import sys
sys.version
output
Num GPUs Available: 0
2.11.0
'3.9.13 (main, Aug 25 2022, 23:51:50) [MSC v.1916 64 bit (AMD64)]'
please give me suggestion
Mine it is on infinite loading when I try to install pakages....
It does! Sometimes it is better to just use pip install in notebooks.
Thanks a lot man
Hi, I followed each and every step, but the results I got after run the block of codes above is:
'''
Num GPUs Available: 0
2.10.0
'3.9.15 (main, Nov 4 2022, 16:35:55) [MSC v.1916 64 bit (AMD64)]'
'''
Could you please show me why this method doesn't work for me
Are you using an Nvidia GPU?
@@minTwin Hello, same issue, and there's nvidia on my laptop.
@@minTwin hello how to do it with intel GPU can you please help