Installing TensorFlow/Keras for CPU and GPU using CONDA (July, 2020)




[ad_1]

This video shows how to set up a CONDA environment containing Keras/Tensorflow and several useful machine learning libraries. CONDA allows you to isolate the GPU drivers into a self-contained environment that greatly simplifies the installation process. The setup shown by this video is designed for my deep learning course; however, it can also serve as a foundation for any deep learning study.

** Follow Me on Social Media!
GitHub: https://github.com/jeffheaton
Twitter: https://twitter.com/jeffheaton
Instagram: https://www.instagram.com/jeffheatondotcom/
Discord: https://discord.gg/3bjthYv
Patreon: https://www.patreon.com/jeffheaton

The GPU used in this video was an NVIDIA TITAN RTX:
https://nvda.ws/2OoXLG7

The following GitHub page contains the steps followed in this video:
https://github.com/jeffheaton/t81_558_deep_learning/blob/master/install/tensorflow-install-jul-2020.ipynb

My Deep Learning course can be found here:
https://sites.wustl.edu/jeffheaton/t81-558/

Source


[ad_2]

Comment List

  • Jeff Heaton
    December 30, 2020

    Thank you Jeff! I have tried so many other tutorials on this issue, but none of them worked… Your Tutorial is realy simple and straigt to the point with some useful information!

  • Jeff Heaton
    December 30, 2020

    Sir, please can u suggest me the current CUDA and cuDNN versions for my GPU (GTX 1060 6gb) ?
    I have tried a lot.. in the end my gpu is not detected by TF ..

  • Jeff Heaton
    December 30, 2020

    Hi Jeff, I got an error while trying to install the tensorflow-gpu version as you did in the video above. See below for error:
    InvalidArchiveError('Error with archive C:\Users\Ivan Aerlic\.conda\pkgs\cudatoolkit-10.1.243-h74a9793_0.tar.bz2. You probably need to delete and re-download or re-create this file. Message from libarchive was:nnbzip decompression failed'). Please let me know what you think when you have a spare moment. Thank you.

  • Jeff Heaton
    December 30, 2020

    Thanks for the video, after days of trying I finally managed to get the gpu recognised as a device in spyder.

    I wonder if you can help further. I'm getting the below error in jupyter when I try fit a model.

    ~anaconda3envstensorflowlibsite-packagestensorflow_corepythoneagerexecute.py in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name)

    65 else:

    66 message = e.message

    —> 67 six.raise_from(core._status_to_exception(e.code, message), None)

    68 except TypeError as e:

    69 keras_symbolic_tensors = [

    ~AppDataRoamingPythonPython37site-packagessix.py in raise_from(value, from_value)

    UnknownError: [_Derived_] Fail to find the dnn implementation.

    [[{{node CudnnRNN}}]]

    [[sequential/gru/StatefulPartitionedCall]]

    [[Reshape_9/_26]] [Op:__inference_distributed_function_2575]

    Function call stack:

    distributed_function -> distributed_function -> distributed_function

  • Jeff Heaton
    December 30, 2020

    Thx Prof. for your directions. It helps a lot. BTW, it seems that Python 3.8 + CUDA 10.1 + cuDNN 7.6 do not work with Tensorflow-gpu 2.3.0…

  • Jeff Heaton
    December 30, 2020

    bruh this is actual hell, I hate doing this stuff. Thanks for making it easier

  • Jeff Heaton
    December 30, 2020

    I tried this on the 18th of December 2020. By now there is a new version of python available 2.8. I changed the version of python in the setup of the environment from 2.7 to 2.8. Everything installed without any error but the final check told me that the GPU is not available. So I repeated the process with the 2.7 version and everything went fine. GPU is now available. On a side note: I like how easy this was compared to when I did this with the full driver setup.

  • Jeff Heaton
    December 30, 2020

    I screwed up my Tensorflow environment this weekend. Followed Jeff’s instructions and was going again in under an hour!!!!

    Last time I think it took 6!

    These are awesome

  • Jeff Heaton
    December 30, 2020

    great video sir, I just want to know. if I installed python ver 3.9 and im using the latest miniconda3 that use python 3.8. will it affect the miniconda if I tick the box of "add miniconda3 to my PATH environment variable".??

  • Jeff Heaton
    December 30, 2020

    Jeff I cannot thank you enough for this video! You've helped so many people

  • Jeff Heaton
    December 30, 2020

    whats the speed of colab and its limitation ?

  • Jeff Heaton
    December 30, 2020

    I am super excited to follow your videos: 42 year old physicist with Matlab experience, never touched python. I just installed Cuda and cuDNN, Anaconda and python-gpu. Also OpenCV (I'm not sure why though but I followed another video). My goal is to ultimately run a trained AI to cartoonize videos and then train another AI with data sets. The code is on github and the output is just spectacular (check out the cartoonized tokyo or st-petersberg videos). Anyway, can't contain my excitement, thanks in advance for sharing!

  • Jeff Heaton
    December 30, 2020

    sir i could not install python 3.7 because it is not available on the website now

  • Jeff Heaton
    December 30, 2020

    those who using amd… and even worse in windows 😫

  • Jeff Heaton
    December 30, 2020

    H:DEEPLEARNINGenvstensorflowlibsite-packagesnumpy__init__.py:138: UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. Please install mkl-service package, see http://github.com/IntelPython/mkl-service

    from . import _distributor_init

    ERROR:root:Internal Python error in the inspect module.

    Below is the traceback from this internal error.

    ERROR:root:Internal Python error in the inspect module.

    Below is the traceback from this internal error.

    ERROR:root:Internal Python error in the inspect module.

    Below is the traceback from this internal error.

  • Jeff Heaton
    December 30, 2020

    Thank you very much, this is really helpfull.

  • Jeff Heaton
    December 30, 2020

    conda install -y jup says "conda is not recognized as an internal or external command" .. when done inside of the anaconda prompt, it says it is collecting package metadata, then says "packagesnotfounderror: the following packages are not available from the current channels" – jupiter" … tried various different spellings, jup, jypiter, jupiter, all same error

  • Jeff Heaton
    December 30, 2020

    I have an error at the point were you install the additional libraries for ML. The line used in command prompt is "conda env update –file tools.yml" All the stepts up until this point worked fine but once i put this in the command prompt in said that "EnvironmentFileNotFound: 'C:UsersUsertools.yml' file not found" If anyone has a solution to this please post it in the reply comment to this comment. Thanks.

  • Jeff Heaton
    December 30, 2020

    Thank you very much for this tutorial. I was able to install tensorflow without any issues. This would be one of the most helpful videos.

  • Jeff Heaton
    December 30, 2020

    I love you

  • Jeff Heaton
    December 30, 2020

    "AttributeError: module 'tensorflow_core.python.keras.api._v2.keras.activations' has no attribute 'swish' " i got this error when i tried to run my NLP code that requires CUDA

  • Jeff Heaton
    December 30, 2020

    Thank You prof!

  • Jeff Heaton
    December 30, 2020

    2:30 thanks for clarifying windows activation. That will keep the trolls shut.

Write a comment