2020, Installing TensorFlow 2.0, Keras, & Python 3.7 in Mac OSX




[ad_1]

Updated for 2020! This video walks you through a complete Python 3.7 and TensorFlow install. You will be shown the difference between Anaconda and MiniConda, and how to create an environment inside of Anaconda for TensorFlow.

Step 1: Download MiniConda [2:19]
Step 2: Install MiniConda [3:04]
Step 3: Install Jupyter [3:53]
Step 4: Download Environment Setup Script [4:13]
About Environment Setup Script [4:58]
Step 5: Run the Environment Setup Script [5:46]

conda env create -v -f tensorflow.yml

Step 6: Test TensorFlow Command Line [6:28]
Step 7: Install Kernel for Jupyter [7:57]

python -m ipykernel install –user –name tensorflow –display-name “Python 3.7 (tensorflow)”

Step 8: Test Jupyter [8:36]

You can find the instructions here (from the video):
https://github.com/jeffheaton/t81_558_deep_learning/blob/master/install/tensorflow-install-jan-2020.ipynb

Other Platforms

Windows 10 CPU: https://www.youtube.com/watch?v=RgO8BBNGB8w&list=PLjy4p-07OYzulelvJ5KVaT2pDlxivl_BN
Mac OSX CPU: https://www.youtube.com/watch?v=MpUvdLD932c&list=PLjy4p-07OYzulelvJ5KVaT2pDlxivl_BN
Windows 10 GPU: https://www.youtube.com/watch?v=qrkEYf-YDyI&list=PLjy4p-07OYzulelvJ5KVaT2pDlxivl_BN

Please subscribe and comment!

Follow me:

YouTube: https://www.youtube.com/user/HeatonRe
Twitter: https://twitter.com/jeffheaton
GitHub: https://github.com/jeffheaton

Source


[ad_2]

Comment List

  • Jeff Heaton
    November 23, 2020

    hello, since I installed python 3.8, i was getting errors installing tensorflow. so i followed the instructions in this video where you can just create new environments and install whatever version of python. in my case i created a new env called python37 and installed python 3.7 instead of 3.8.The video also explains how you can just install any package by : conda install tensoflow . this is good for those who are having problems saving the script on this video.https://www.youtube.com/watch?v=yEaonoulP3w

  • Jeff Heaton
    November 23, 2020

    Hello, @4:45, where it reads dependencies: python 3.7. should I change that to 3.8 since that's the latest version

  • Jeff Heaton
    November 23, 2020

    Hi Professor, Thanks for the great video. I tried to follow the instructions, installed Python 3.8 which is the one available for Mac, and I am facing issues on the step 4. below are the message after running the command: conda env create -v -f tensorflow.yml

  • Jeff Heaton
    November 23, 2020

    I can't save the page at 4:55 with .yml at the end. it insists that I have to have .txt at the end and that the format is "text". can anyone help me please?

  • Jeff Heaton
    November 23, 2020

    /Users/MyName/miniconda3/bin/python: No module named ipykernel
    Edit: FIXED i was using pip instead of pip3

  • Jeff Heaton
    November 23, 2020

    time to make my dream, AIMBOT

  • Jeff Heaton
    November 23, 2020

    Thanks professor. This works on OS El Capitan 10.11.6. I was having some trouble installing tensorflow 2.0 yesterday and I thought that it might have been down to my OS.

  • Jeff Heaton
    November 23, 2020

    I spent two days trying to get tensorflow installed on my Mac and it failed. I googled the error it was such a common problem but none of the solutions worked for me. It took me 5 minutes to get everything working by following this video. Thank you so much !!

  • Jeff Heaton
    November 23, 2020

    For your jupyter notebook to see your conda env, you can do "conda install Notebook" after activating the env.

  • Jeff Heaton
    November 23, 2020

    Since the latest version of Python and TensorFlow have supported each other, Py3.8 and TF2.2, would there be any good reason to update both of them? Thanks Professor!

  • Jeff Heaton
    November 23, 2020

    Hello Sir , I am getting ERROR : " zsh: command not found: conda " in terminal please upgrade or help out with this issue please

  • Jeff Heaton
    November 23, 2020

    Hello~It doesn't work when I type Conda install jupyter in terminal. The error is command not found conda, what should I do?

  • Jeff Heaton
    November 23, 2020

    I'm having a really hard time saving the .yml file. It looks like my Macbook will only accept html? Not sure what I'm doing wrong here but it doesn't like this format

  • Jeff Heaton
    November 23, 2020

    Thank you so much, professor! Greetings from the Netherlands!

  • Jeff Heaton
    November 23, 2020

    In step 7, i can’t install ipykernel and it says No module named ipykernel. Help!

  • Jeff Heaton
    November 23, 2020

    Sir i got error that Keras requires TensorFlow 2.2 or higher. I tried to update the yml file with this tf version but that didnt work. I tried upgrading didnt work either. Then i uninstalled tf and now i cant reinstall it back. I am working on MacOs 10.10.

  • Jeff Heaton
    November 23, 2020

    Great video!! Thank You.

  • Jeff Heaton
    November 23, 2020

    I have tried for days to install Tensorflow with errors and errors but this video is what finally got me out of all frustrations. Thanks so much!

  • Jeff Heaton
    November 23, 2020

    step 5 isnt working for me

  • Jeff Heaton
    November 23, 2020

    For those having issue with the dreaded command not found when you execute the command conda you will need to find where conda was installed on your Mac. For me it was in the /home/username/opt directory. If you execute the command "export PATH="/home/username/miniconda/bin:$PATH"" in a terminal session substituting the location where conda was installed you are golden. Remember to exit and restart terminal to get your new path loaded. For me the command was "export PATH="/home/username/opt/miniconda/bin:$PATH"

  • Jeff Heaton
    November 23, 2020

    Have you found it possible or easy to use, say an old 2012 Cheese Grater Mac Pro with an NVIDIA GPU like a 1080 or 1080 TI or TITAN for Anaconda, tensorflow, pytorch, etc. in the following ways:
    1) Directly from MacOS?
    2) In a Linux VM, say, using Parallels, VMware, VirtualBox or some other VM?
    3) In a Windows 10 VM, say, using Parallels or some other VM?

    I guess what I'm wondering is if I buy an old 2012 Mac Pro with a 1080, and 64G of RAM and 1TB or so of SSD, will I be able to get the full horsepower of the GPU for creating and learning somewhat substantial deep learning models?
    Or would I find it unable to see the GPU? I imagine the GPU would be useful for speeding up video editing or for video games, but I'm wondering if Anaconda/Python/Jupyter Notebooks would be able to see it directly, or in a Windows or Linux VM, or perhaps in a Docker container in a Linux VM.

    In short, would I be able to get the horsepower of one or perhaps later, more GPUs in MacOS or in a VM or a Docker container if I do this on a Mac Pro?
    Thanks,
    Dan

  • Jeff Heaton
    November 23, 2020

    Hi there. Having some problems when running environment set up scripts. After running 'conda env create -v -f tensorflow.yml' I recieve this call back:
    Collecting package metadata (repodata.json): …working… done
    Solving environment: …working… failed
    Traceback (most recent call last):
    File "/Users/sambeattie/opt/miniconda3/lib/python3.7/site-packages/conda/exceptions.py", line 1079, in _call_
    return func(*args, **kwargs)
    File "/Users/sambeattie/opt/miniconda3/lib/python3.7/site-packages/conda_env/cli/main.py", line 80, in do_call
    exit_code = getattr(module, func_name)(args, parser)
    File "/Users/sambeattie/opt/miniconda3/lib/python3.7/site-packages/conda_env/cli/main_create.py", line 111, in execute
    result[installer_type] = installer.install(prefix, pkg_specs, args, env)
    File "/Users/sambeattie/opt/miniconda3/lib/python3.7/site-packages/conda_env/installers/conda.py", line 32, in install
    prune=getattr(args, 'prune', False), update_modifier=UpdateModifier.FREEZE_INSTALLED)
    File "/Users/sambeattie/opt/miniconda3/lib/python3.7/site-packages/conda/core/solve.py", line 117, in solve_for_transaction
    should_retry_solve)
    File "/Users/sambeattie/opt/miniconda3/lib/python3.7/site-packages/conda/core/solve.py", line 158, in solve_for_diff
    force_remove, should_retry_solve)
    File "/Users/sambeattie/opt/miniconda3/lib/python3.7/site-packages/conda/core/solve.py", line 275, in solve_final_state
    ssc = self._add_specs(ssc)
    File "/Users/sambeattie/opt/miniconda3/lib/python3.7/site-packages/conda/core/solve.py", line 555, in _add_specs
    explicit_pool = ssc.r._get_package_pool(self.specs_to_add)
    File "/Users/sambeattie/opt/miniconda3/lib/python3.7/site-packages/conda/resolve.py", line 553, in _get_package_pool
    pool = self.get_reduced_index(specs)
    File "/Users/sambeattie/opt/miniconda3/lib/python3.7/site-packages/conda/common/io.py", line 88, in decorated
    return f(*args, **kwds)
    File "/Users/sambeattie/opt/miniconda3/lib/python3.7/site-packages/conda/resolve.py", line 574, in get_reduced_index
    explicit_specs, features = self.verify_specs(explicit_specs)
    File "/Users/sambeattie/opt/miniconda3/lib/python3.7/site-packages/conda/resolve.py", line 288, in verify_specs
    raise ResolvePackageNotFound(bad_deps)
    conda.exceptions.ResolvePackageNotFound:
    – tensorflow-gpu=2.1.0

    Any help would be greatly appreciated.

  • Jeff Heaton
    November 23, 2020

    Thx for nice setup docs. I was crashing on building models due to MKL issues on Mac:

    I needed to run the following:
    conda install nomkl
    conda install numpy scipy pandas tensorflow
    conda remove mkl mkl-service

    From: https://stackoverflow.com/a/58869103

  • Jeff Heaton
    November 23, 2020

    Thank you for the smooth installation. Worked well !!

  • Jeff Heaton
    November 23, 2020

    Thank you for this great and thorough step-by-step installation. It was what I was missing to start in the right direction. Greatly appreciated.

  • Jeff Heaton
    November 23, 2020

    I am getting an error when running the command: "conda install jupyter" The error states: "zsh: command not found: conda". Any suggestions would be appreciated 😀 (Edit: I am running on MacOS 10.15.5)

  • Jeff Heaton
    November 23, 2020

    smoothest Installation!!!

  • Jeff Heaton
    November 23, 2020

    Hi, Thank you!
    I am trying to install Miniconda but my computer automatically opens it with Xcode and not the installer so I cannot install it

  • Jeff Heaton
    November 23, 2020

    I am getting an error while creating the virtual environment. PLS help

  • Jeff Heaton
    November 23, 2020

    Thank you very much for proper installation guide for Tensorflow for MAC

  • Jeff Heaton
    November 23, 2020

    Great Video! So the difference between anaconda and miniconda is that miniconda comes with python + conda and anaconda comes with additional packages?
    Also I would like to add that if you install nb_conda_kernels in the tensorflow environment you don't need to manually install the kernels for jupyter and you can use any kernel in any environment. I found this helpful when working with multiple environments as I always forget to install the kernels for jupyter.

  • Jeff Heaton
    November 23, 2020

    Great help! Thanks for posting this tutorial!

  • Jeff Heaton
    November 23, 2020

    Mac OS 10.15.4 Catalina: I just follow the steps but I get 'zsh: command not found: conda'

  • Jeff Heaton
    November 23, 2020

    Thank you so much. So easy and got it working without any errors.

  • Jeff Heaton
    November 23, 2020

    Thanks for the very detailed video !

  • Jeff Heaton
    November 23, 2020

    thnx!

  • Jeff Heaton
    November 23, 2020

    Hi! Thanks for your nice work.

    I am using Catalina 10.15.4

    Unfortunately I get this error:
    NotADirectoryError: [Errno 20] Not a directory: 'xdg-settings'

    If I run with "jupyter notebook –no-browser" i can then manually load the address into google chrome. I wonder if someone understands how i can configure the environment appropriately to launch in chrome with no error??

  • Jeff Heaton
    November 23, 2020

    conda env create -v -f tensorflow.yml this does not work, it shows file not found, how can I solve this

  • Jeff Heaton
    November 23, 2020

    Thank you So much

    I want to be your friend

  • Jeff Heaton
    November 23, 2020

    thanks professor!

  • Jeff Heaton
    November 23, 2020

    How to install other dependencies inside the TensorFlow virtual environment (dependencies apart from the above mentioned in your file) ?

  • Jeff Heaton
    November 23, 2020

    Hi! Thanks for such a smooth installation guide.

  • Jeff Heaton
    November 23, 2020

    Thank you so much sir….you resolved my problem 🙂

  • Jeff Heaton
    November 23, 2020

    Thank you so much for this video . I’ve spent weeks trying to do this on my own 😅

Write a comment