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.

Комментарии • 131

  • @MohamedAshraf-zs6nv
    @MohamedAshraf-zs6nv 3 года назад +50

    after suffering for more than a week to make tensorflow integrate with GPU, finally, you saved me. Thanks,

  • @ultankearns
    @ultankearns Год назад +14

    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!

    • @minTwin
      @minTwin  Год назад +1

      Glad I could help!

  • @andreipotra248
    @andreipotra248 2 года назад +4

    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!

  • @facebookandyoutubetrickess5820
    @facebookandyoutubetrickess5820 2 года назад +2

    Thanks God U are here on RUclips Otherwise i was Failed in ML PROJECT ❤️❤️❤️❤️

  • @Arkarkyawwin
    @Arkarkyawwin 3 года назад +4

    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.

  • @satish9367
    @satish9367 3 года назад +7

    It helped a lot. Thank You. This is easier than doing it on anaconda prompt.

  • @StEvUgnIn
    @StEvUgnIn 9 месяцев назад

    I didn’t know Intel had support for CUDA. Thank you.

  • @harshadapatke4363
    @harshadapatke4363 2 года назад +6

    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?

    • @wimr.9672
      @wimr.9672 2 года назад +1

      same "problem" here, how long did it take?

    • @jolenechng3900
      @jolenechng3900 2 года назад +11

      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 :)

    • @hmertyldr
      @hmertyldr 2 года назад +1

      @@jolenechng3900 LOL i literally did the same thing then i saw your comment

  • @oriol-borismonjofarre6114
    @oriol-borismonjofarre6114 3 года назад +1

    My man, you are amazing!

  • @d.sullivan6792
    @d.sullivan6792 Год назад +1

    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

  • @marcosbeliera1
    @marcosbeliera1 2 года назад +11

    Not working for me..It's showing no. of gpus as 0 only

    • @sandeepunnikrishnan9885
      @sandeepunnikrishnan9885 Год назад

      Same here did u get an answer to that?

    • @minTwin
      @minTwin  Год назад

      Make sure you are doing this on a PC with a Nvidia graphics card. I was using a 1080TI with my example.

    • @Stefan-hp4pz
      @Stefan-hp4pz Год назад +3

      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.

  • @marcusanderson8180
    @marcusanderson8180 3 года назад +3

    Very helpful video. Made it very easy to start utilizing my GPU.

  • @siddhesh119369
    @siddhesh119369 2 года назад +2

    Thanks A lot, it saved lot of time

  • @shwetanshusood9450
    @shwetanshusood9450 Год назад +1

    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

    • @minTwin
      @minTwin  Год назад

      Try using a different version of python.

    • @sheilamaecraus9431
      @sheilamaecraus9431 Год назад +1

      Did changing the Python version work? I am currently having this issue as well.

  • @pritishpattnaik4674
    @pritishpattnaik4674 2 года назад

    Thanks a lot bro u solved my problem , I was unable to run my deep learning models

  • @ridamahmood3342
    @ridamahmood3342 Год назад

    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!

  • @adriancanellaortiz1057
    @adriancanellaortiz1057 2 месяца назад

    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)

  • @yatharthm22
    @yatharthm22 5 месяцев назад

    I am currently connected to a remote GPU, what would be the equivalent code for that?

  • @robertbarrios9969
    @robertbarrios9969 Год назад +1

    It does not work with my laptop. The tensorflow-gpu library does not download, Conda stays loading for hours to download just that library.

    • @minTwin
      @minTwin  Год назад

      Its recommended to do this on a PC with a Window OS.

    • @robertbarrios9969
      @robertbarrios9969 Год назад

      @@minTwin I have Windows OS

  • @himanimadaan5681
    @himanimadaan5681 3 года назад +7

    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?

  • @Debertan1998
    @Debertan1998 Год назад +1

    Its been stuck at the installing packages for a while. How could I solve this issue?

    • @NguyenTLiem
      @NguyenTLiem 11 месяцев назад

      me too, I'm stuck at "solving package specifications"

  • @jishnuparantapa2202
    @jishnuparantapa2202 Год назад +1

    Thank you so much for this tutorial, I ran into some errors but it worked after struggling through it a bit!

  • @yerassylkelsingazin2408
    @yerassylkelsingazin2408 3 года назад +1

    Why I don`t have this list on 01:07 ? It`s a blank page in my case

  • @sidarth404
    @sidarth404 Год назад

    It show DLL problems. And not working in i7 12gen RTX 3050.

  • @tonyennis1787
    @tonyennis1787 2 года назад +2

    I followed this, I could not get it to work.

  • @ScriptureFirst
    @ScriptureFirst 3 года назад +2

    Music: disruptive

  • @yeahright5663
    @yeahright5663 Год назад +1

    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.

    • @imaanemidouune5419
      @imaanemidouune5419 11 месяцев назад

      Did you find how to do it as I’m on the same shoes as you?

    • @yeahright5663
      @yeahright5663 11 месяцев назад

      @@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!

    • @zora7241
      @zora7241 5 месяцев назад

      Same here

  • @himanshumanke753
    @himanshumanke753 7 месяцев назад +1

    Thanks finally done

  • @mohsenghafari7652
    @mohsenghafari7652 4 месяца назад

    thanks dear . you tutorial work for 3080 nvidia gpu?

  • @ShredTubeFitness
    @ShredTubeFitness 2 года назад

    Thanks for this video man

  • @haardhikkunder9436
    @haardhikkunder9436 11 месяцев назад

    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 ?

  • @Jandoesrun
    @Jandoesrun 3 года назад +2

    Does this work with Scikit learn library?

  • @joaosobral1354
    @joaosobral1354 3 года назад +1

    It worked. Thanks

  • @paul-ie
    @paul-ie 3 месяца назад

    what about CUDA if you have nvidia gpu?

  • @AyushSharma-qd1lq
    @AyushSharma-qd1lq 2 месяца назад

    what about radeon gpus

  • @yezidalejandrogarciacabrej282
    @yezidalejandrogarciacabrej282 6 месяцев назад +1

    It's that KOF 96 theme in the background?

  • @md.arrahmandip7638
    @md.arrahmandip7638 Год назад

    i have 3060 installed in my pc, but the returns 0 as no of gpus

  • @ilhamramda
    @ilhamramda 3 года назад +1

    Is it works on amd gpu? I have rx570

  • @deeplySaid__
    @deeplySaid__ 3 года назад +2

    thanks a lot man!

  • @anirudhsom6590
    @anirudhsom6590 4 месяца назад

    gpu available showing : 0 what to do pls tell

  • @ahmed.bhewary775
    @ahmed.bhewary775 3 года назад +3

    what about CPU ?

  • @umutduran1784
    @umutduran1784 3 месяца назад

    cudnn ?? cuda toolkit??

  • @waytakaq
    @waytakaq Год назад +2

    why do I not get the tensor flow options

    • @dhruvil8
      @dhruvil8 Год назад

      did you find any solutions?

    • @waytakaq
      @waytakaq Год назад

      @@dhruvil8 no i just jump into a terminal and install it myself

  • @tutosolve
    @tutosolve Год назад +1

    nice video . From vietnam

  • @rockpaper5578
    @rockpaper5578 10 месяцев назад

    question! if my python is 3.11, do I still have to make it 3.6 on "Create new environment"?

    • @ThePablo505
      @ThePablo505 10 месяцев назад +1

      I'm trying to do it with 3.6 and it does not load. Also having trouble with 3.11 xd

  • @nuggi12
    @nuggi12 2 месяца назад

    Awesome video! The music was too loud and interruptive though

  • @egocarpo
    @egocarpo 3 года назад +2

    Thanks!

  • @battumohit8141
    @battumohit8141 4 года назад +2

    Thanks a lot

  • @shakthivelsaravanan9263
    @shakthivelsaravanan9263 3 года назад +1

    Thank you sooo much

  • @chummicrisologo2474
    @chummicrisologo2474 3 года назад +2

    Mine says 0 after running the gpu test :+{ Am I supposed to manually install a new ipykernel for this?

    • @chummicrisologo2474
      @chummicrisologo2474 3 года назад +1

      got it working already! thanks :+}

    • @yassineaderkaoui3598
      @yassineaderkaoui3598 3 года назад +1

      @@chummicrisologo2474 How did you manage to solve it? It stills returns 0 for me

    • @chummicrisologo2474
      @chummicrisologo2474 3 года назад +11

      @@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.

    • @yassineaderkaoui3598
      @yassineaderkaoui3598 3 года назад +4

      @@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!

    • @chummicrisologo2474
      @chummicrisologo2474 3 года назад +1

      @@yassineaderkaoui3598 sure thang brother

  • @sanasayyed4014
    @sanasayyed4014 Год назад

    After creating environment and installing all the library it's showing available GPU 0

    • @minTwin
      @minTwin  Год назад

      Did you try using Jupyter Notebook?

  • @e97105
    @e97105 2 года назад +3

    Is it mandatory to use python 3.6 version? is it fine to go with 3.8 or 3.9?

    • @minTwin
      @minTwin  Год назад

      I think using newer versions of python is fine.

  • @SAURABHGUPTA_DINOSAUR
    @SAURABHGUPTA_DINOSAUR Год назад

    It says tensorflow-gpu is removed now

  • @eekinchan6620
    @eekinchan6620 11 месяцев назад

    does this work with pytorch?

  • @rosheng5063
    @rosheng5063 2 месяца назад

    mass bro nee

  • @kirolloseisa
    @kirolloseisa 10 месяцев назад

    Does it work with AMD ??

  • @ahuman8711
    @ahuman8711 Год назад

    i did this but it still say false

  • @NavneetMann-ew9er
    @NavneetMann-ew9er Год назад

    So you do not need cuda toolkit installed at all?

  • @sanasayyed4014
    @sanasayyed4014 Год назад

    Anyone know how to resolve this error please give me suggestions

  • @ÃÑØÑŸMØÛŠ-X69
    @ÃÑØÑŸMØÛŠ-X69 Год назад

    what about VS CODE PLEASE TELL MY VS CODE USING CPU

  • @Paris-hu3qd
    @Paris-hu3qd 2 года назад

    You are an angel from the Heaven

  • @doodrobe1761
    @doodrobe1761 2 года назад +1

    do i need to install cuda and cunn before?

    • @minTwin
      @minTwin  Год назад +1

      Yes

    • @jishnuparantapa2202
      @jishnuparantapa2202 Год назад

      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!

  • @boysrcute
    @boysrcute 7 месяцев назад +4

    PLEASE, fix your tutorial

  • @harshbirsingh2938
    @harshbirsingh2938 Год назад

    bro how much time adding packages will take?

    • @minTwin
      @minTwin  Год назад

      Downloading packages can be very quick depending on your PC's build.

  • @salehsaleh8864
    @salehsaleh8864 Год назад +1

    Thanks a lot , but please remove the music

  • @everythingwithanirudha
    @everythingwithanirudha 2 года назад +1

    I have gtx 10505ti 4gb VRAM

  • @aadityakumarravi510
    @aadityakumarravi510 4 месяца назад

    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.

  • @lxt-j1q
    @lxt-j1q 5 месяцев назад

    thanks

  • @adeputri8601
    @adeputri8601 Год назад +1

    why does installing jupyter lab on new environment takes more than 2 hours [yet still not finish]?

    • @minTwin
      @minTwin  Год назад

      Probably need to upgrade your hardware such as your CPU and RAM.

    • @adeputri8601
      @adeputri8601 Год назад +1

      @@minTwin its intel i7 core 11th generation with 16gb RAM. i dont think its the problem. Its solved by other tutorial video

    • @iloveyoubro6609
      @iloveyoubro6609 Год назад

      bro i have the same problem, did you find the solution ? Or did you find another method ? Please respond, i will be very grateful

  • @valentinfontanger4962
    @valentinfontanger4962 3 года назад +1

    thanks a lot ! It's working for me :)

    • @aftabansari3845
      @aftabansari3845 3 года назад +1

      can it work with Intel Integrated gpu 620? please reply

  • @DominiqueBarnes-jt3zq
    @DominiqueBarnes-jt3zq Год назад

    Ddoes this work on mac??

    • @minTwin
      @minTwin  Год назад

      Different approach is required on Mac.

  • @rex_2231
    @rex_2231 3 года назад +1

    is there any alternative for anaconda

  • @ThePablo505
    @ThePablo505 5 месяцев назад +1

    u deleting comments

  • @RanjeetKumar-te7yh
    @RanjeetKumar-te7yh 5 месяцев назад

    Num GPUs Available: 0

  • @santathenoobda1833
    @santathenoobda1833 2 года назад

    bgm is good

  • @SufyanDanish
    @SufyanDanish Год назад

    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

  • @mariustuca6221
    @mariustuca6221 7 месяцев назад +1

    Mine it is on infinite loading when I try to install pakages....

    • @yashjain5651
      @yashjain5651 6 месяцев назад +1

      It does! Sometimes it is better to just use pip install in notebooks.

  • @apollofikz3738
    @apollofikz3738 2 года назад +1

    Thanks a lot man

  • @famanh9253
    @famanh9253 Год назад

    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

    • @minTwin
      @minTwin  Год назад +1

      Are you using an Nvidia GPU?

    • @andreansihombing6780
      @andreansihombing6780 Год назад

      @@minTwin Hello, same issue, and there's nvidia on my laptop.

    • @AryanPatel6879
      @AryanPatel6879 Год назад +1

      @@minTwin hello how to do it with intel GPU can you please help