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])
  • НаукаНаука

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

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

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

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

    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

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

    Thanks very much for this insightful lecture, it was very helpful. You're the best!

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

    Thank you for the video!!! It really helps me a lot!!!!

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

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

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

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

    • @DigitalSreeni
      @DigitalSreeni  3 года назад

      Excellent!!! I went through a bit of a learning curve while getting my first system ready. The second time worked like a charm.

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

    Thanks for the very detailed guide!

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

    permission to learn sir. thank you

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

    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.

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

      The process can be tricky. New environment gives you a blank slate that minimizes any issues. I am glad you got it working.

  • @kenanmorani9204
    @kenanmorani9204 3 года назад

    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.

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

    This Session Helps me alot, past few days ago i busted my TF Environment🎇🎇🎇.

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

    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?

  • @freebooks4456
    @freebooks4456 3 года назад

    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.

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

      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.

  • @zed6571
    @zed6571 3 года назад

    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.

  • @normalperson1130
    @normalperson1130 3 года назад

    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

    • @DigitalSreeni
      @DigitalSreeni  3 года назад

      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

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

    Nice Video, Thanks for that, Can you show how to install lightgbm-gpu, it has several steps that are confusing, Thanks

  • @furkan2724
    @furkan2724 3 года назад

    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

  • @user-jk6lm8oy3r
    @user-jk6lm8oy3r 10 месяцев назад

    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.

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

    Thank you sir

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

    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?

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

      These steps will work in general. You need to make sure you pick the right CUDA, Drivers, and CUDNN for your GPU.

  • @enescelik5633
    @enescelik5633 7 месяцев назад

    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?

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

    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)

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

    what if RTX 3080 TI, and RTX 3050 Laptop GPU ? its not on the list, so it does not have GPU??

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

    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.

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

    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.

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

    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.

  • @IItianrider6627
    @IItianrider6627 3 года назад

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

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

      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.

    • @IItianrider6627
      @IItianrider6627 3 года назад

      @@DigitalSreeni thanx a lot.

  • @achintya-7
    @achintya-7 3 года назад

    Do we not need to update the environment variables as well

    • @DigitalSreeni
      @DigitalSreeni  3 года назад

      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.

  • @azamatjonmalikov9553
    @azamatjonmalikov9553 3 года назад

    Thank you ok ok

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

    This works with CUDA 11.2, cuDNN 8.1.0 @ Dec 07 2021

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

      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.

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

      @@DigitalSreeni Yes, I followed the instructions in your video and followed the package versions specified on the Tensorflow website.

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

    My tf still shows only cpu

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

    Ati no work? :(

  • @pallavi.munihanumaiah7786
    @pallavi.munihanumaiah7786 2 года назад

    Sir, any idea about this error "ds tensor not initialised"

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

      No, never encountered. May be related to out of memory issues but have no personal experience to offer advice.

    • @pallavi.munihanumaiah7786
      @pallavi.munihanumaiah7786 2 года назад

      Ok sir

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

    tensorflow 2.11 stops supporting gpu on windwos native system. it is so sad.

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

      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.

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

      @@DigitalSreeni Thanks so much. and your lectures on youtube really helps me a lot. thanks again.