Best hands on tutorial ever about installation. Definitely gotta subscribe. I spent days searching for ways to install tensorflow on Mac M1 and couldn't get it done at all. Jeff saved my life!
Definitely a time-saving and life-saving video for a confused new M1 user who is trying to use tensorflow on his seemed-powerful-but-no-clue machine. Thanks!
Jeff, you are a great instructor... but I'm sure I'm not telling you anything you haven't heard many times before. I have been studying, doing and learning comp sci since the 80's when I graduated in Computer Science. I have taught and lectured in many areas over the years, and had some great instructors, researchers and others I have worked with. I love how much care you take to anticipate questions and potential problems and pitfalls. AMAZING JOB, and thanks!
I can count the number of UA-cam comments I have made on two hands. This is the only correct answer I found to effectively install Miniconda to manage packages for bioinformatics on my new M1-powered MacBook (I don't use Tensorflow, but now all of my packages are installing correctly). Your video is thorough, concise, and wholly correct (as of 12-27-2021). I could not find the links in the description (as mentioned in other comments). Thank you so much for this tutorial!
A great hands-on tutorial on installing tensorflow on Mac M1. I struggled a lot till I came across this tutorial. Jeff, you have explained everything so well! Thanks.
This is the absolute best way to organize your conda distributions and get tensorflow to use GPU on your M1 Mac. I can only add that it will work perfectly fine if you already have anaconda and you are just adding miniforge, just take a look at your .zshrc and check if your conda initialization corresponds to what you want to initialize. Thanks Jeff!
Thank you so much! Great video and excellent explanation. Two reinstalls and many hours later, I finally see the light thanks to this video. It should be the mandatory tutorial packed with all Apple Silicon machines.
Thank you so muchhhhh, sooooo muchhhhhhh. I was trying to install TensorFlow in my Mac m1 chip since so long but I couldn't find any complete guide but this video just helped. without wasting point just directing to the main task
Jeff, Thank you very much. After hours of frustration of trying to get TF to run on the M1 chip I found your video. Not even halfway through the video I was up and running. :)
On the part at 13:59 min of the video when I try to run the cell I get : ModuleNotFoundError: No module named 'tensorflow'. , any idea how to solve it?
Hi Jeff - Thanks for this video! I have already installed miniconda with brew. So what I did to be able to have miniforge as default, but keep the miniconda installed with brew is: - extract the >>> conda initialize >>> section in .zshrc into separate .sh files (~/.init_miniforge.sh and ~/.init_brew_minconda.sh) - source the ~/.init_miniforge.sh file in .zshrc as default This will allow me to: - init miniforge by default upon start of any zsh shell - change between miniforge / miniconda in any zsh shell by sourcing the corresponding init_xx.sh file (without sourcing the full .zshrc file each time, which is rather long) - allow me to activate miniforge / miniconda from other shells (which I sometimes, but rarely use) Thanks again - this is a really simple and clean solution! :)
You are a lifesaver. Thank you. I just had to wipe my new M1 two different times because I tried to migrate my old Anaconda from my old MacBook Pro Intel and it totally messed a bunch of things up. This is the video I have been looking for this whole time --why didn't I find it before??
Jeff, you rock! Btw, as of today on OS 12.3, I would recommend to not specify any versions (except for python 3.9) in the yml file. It works flawlessly! Thousand thanks!
I should say I'm on Monterey 12.3.1 and running oh-my-zsh too; so this complicates my .zshrcfile and environment a tiny bit. Thanks again. I understand conda initialization better now.
Hey Jeff.. FYI: If you typed python3 on the command line instead of python, Xcode would install Python3 for you as part of its bundle.(to /usr/bin/python3 - 3.8.9 on Monterey 12.2.1 at time of writing) (@4:45 it actually uses that on the Apple linked page. But I then get confused. Should Apple not have stated use python3 for the pip install?) PS: Was that your dog snoring in the background ;-)
Thanks for the great tutorial Jeff! It works on my machine, except for what you are showing at 19'. I have Miniconda, Miniforge AND Anaconda installed on my Mac. I plan to get rid of Anaconda though. When listing the environments from Miniforge, I see them all. When doing that from Miniconda I see Miniconda and Anaconda envs, but not Miniforge envs. I followed your steps very thoroughly though. Any idea? Many thanks
Thank you very much, it is one of the best video to setup environments on Mac M1. Quick questions I followed the video till the end and copy miniforge to zshrc to make it default, now how can I revert that operation as my currently doing MS in Data Science so is there a way that deep learning will only be working on Miniforge's tensorflow env and rest of my Machine learning Algorithms works on mini conda
Hi Jeff! excuse my ignorance if I'm asking some stupid question. I saw we installed tensorflow in TensorFlow(conda env) why are we running jupyter notebook on base env? Should we go to our tensorflow or base env to install a new package?
Things appear to have changed. Brew install miniforge installed into /opt/homebrew/Caskroom/miniforge/base. BTW, have you installed direnv for automatically switching to the right env? If you have a link to instructions, please share it. I'm having trouble. Thank you.
Hello, First of all I would like to thank you for all the information. I tried creating (inside miniforge3) a virtual environment with python=3.7 and it displays this: "PackagesNotFoundError: The following packages are not available from current channels: - python=3.7.12". How can I install virtual environments inside miniforge3 or miniconda3 with different python versions? Also I could follow up these instructions but for some reason I cannot replicate them.
Thank you so much , I 'm so confuse about environment but tonight it's almost clear and now i can install tensorflow and can use GPU on M1 Thank you so much
Sir, this is so good. I wished to know during the installation i saw you had one folder showing tensorflow_datasets, so how do we download on m1, as in the video there was no mention of this.
Prof Heaton, can I seek your advise how to install other dependencies such as numpy, openpyxl, xlrd, etc. not included in the "tensorflow-apple-metal.yml" file? I have performed a conda install of the add-on dependencies under "base" environment but when I keep getting error message that these modules are not installed. Do I require to conda activate to "tensorflow" environment to re-perform the conda install for these dependencies again in order for them to take effect?
Hey Jeff, great video. I have a question, I had already installed anaconda on my mac with M1 chip, then installed miniforge. When i open the terminal and type which python i get: /Users/sleig/miniforge3/bin/python But when i open spyder from anaconda navigator and run it. Activity manager still shows "kind" as Intel, 0 % GPU, and when i look at "Open Files and Ports" I see the python that is running is: /Users/sleig/opt/anaconda3/bin/python3.9 Is there a way to fix this? I am not a computer scientist but use python for my research so working in the terminal is quite foreign to me. Also I much prefer spyder to jupyter notebooks. Thanks!
Thanks Sir for this brilliant hands-on tutorial. It saved us hours/days worth of research to get TF to use GPU on Mac M1. Sir, after hours of research and experimentation - I have not been able to get Tensorflow Object Detection API to work with Mac M1. So, can you please cover in a future video - 1. If Tensorflow Object Detection API can at all work on Mac M1 ? 2. If Yes, How should we go about installing the Tensorflow Object Detection API on Mac M1 Sir, we are grateful for your informative videos and making AI easy and accessible to everyone. Thanks Sir !
Hi Jeff, really great tutorial on the installations pal via conda, I have a question that I have been struggling with for some weeks and cannot seem to find a solution. I am trying to run anaconda navigator on the new MI mac 2014. The thing is the application constantly crashes. I notified anaconda via email and got no response as well as ghit, stacks, and google. That brought me to you, do you have a tutorial on installing the anaconda navigator for Mac? what I am really trying to use is Spyder and I got so used to the application as a novice! it would be fantastic if you can point me in the right direction. This works well on my old mac but it's so problematic on the new one or rather technical to install for me. The main reason for getting this was the GPU processing and now I am not sure how to implement this. I followed all of your instructions but I am so familiar with the user-friendliness of the navigator that I am not sure what to do next. Lacking the knowledge, I guess. Can you point me in the right direction, pretty pretty, Please? This was the best demonstration in reference to deploying all the steps in terms of easy to follow and deploy.
if you install anaconda instead of minicoda and start your navigator, then you can start the tensorflow env. There you would see the option to install jupyterlab. I have done it and it works like a charm!
Thank you for interesting video. can you make some performance tests of m1 gpu and compare it to one of your nvidia gpus? in addition it would be great if you tell something about typical benchmarks for typical networks like CNN(i don't know is there any difference between performance tests for CNN or RNN or regular NN)
Hey Jeff! Thanks a lot for this great video. Could u also make one how to install opencv on MacOS Monterey m1. I need that for my master thesis don’t have much time until the deadline to deliver my final results. And maybe, if it is not much to ask, could u show how to install yolov4 for object detection custom dataset. Thanks a lot in advance.
Awesome tutorial, thank you very much! Any chance you have any info on how to install the Tensorflow Object Detection API from here? I'm using miniforge as well, but I keep getting hardware errors/illegal instruction errors.
Yup. You need to install lckr variable explorer. Just launch jupyter lab & follow the instructions for installing this extension. Only one thing to note: Variable explorer in jupyter lab is a slightly lower version of variable explorer in spyder in the sense that you cannot see all the rows by just using this lckr version. You’ll have to print the variable if you want to see the entire contents of the variable/list. Nevertheless it solves the purpose
I’m not exactly the tech guy😅. But the way I like to open IDEs is by using terminal only. So after you’ve activated your environment, you can do the following steps (commands) 1. pip install jupyterlab 2. pip install lckr-jupyterlab-variableinspector 3. jupyter lab 4. Open a new python 3 environment 5. Create any list 6. Right click anywhere on environment & open variable inspector Do let me know if this works
Do NOT use 2.7. Its just what comes on Macs by default (at least for now). Seeing 2.7 pop up at the version is just a technique I use to verify that no external Pythons are currently running on the mac beyond what the mac was "born with".
Jeff thank you for your effort in making this video, I really appreciate it 🙏. I still have a tough time with a library called stellargraph, seems to me they are not good friends yet with m1 🤨
--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) Cell In [1], line 4 1 # What version of Python do you have? 2 import sys ----> 4 import tensorflow.keras 5 import pandas as pd 6 import sklearn as sk ModuleNotFoundError: No module named 'tensorflow' Problem was with numpy lib, and also bad version of keras.
Best hands on tutorial ever about installation. Definitely gotta subscribe. I spent days searching for ways to install tensorflow on Mac M1 and couldn't get it done at all. Jeff saved my life!
Thanks, and welcome!
Definitely a time-saving and life-saving video for a confused new M1 user who is trying to use tensorflow on his seemed-powerful-but-no-clue machine. Thanks!
Jeff, you are a great instructor... but I'm sure I'm not telling you anything you haven't heard many times before. I have been studying, doing and learning comp sci since the 80's when I graduated in Computer Science. I have taught and lectured in many areas over the years, and had some great instructors, researchers and others I have worked with. I love how much care you take to anticipate questions and potential problems and pitfalls. AMAZING JOB, and thanks!
I can count the number of UA-cam comments I have made on two hands. This is the only correct answer I found to effectively install Miniconda to manage packages for bioinformatics on my new M1-powered MacBook (I don't use Tensorflow, but now all of my packages are installing correctly). Your video is thorough, concise, and wholly correct (as of 12-27-2021). I could not find the links in the description (as mentioned in other comments). Thank you so much for this tutorial!
A great hands-on tutorial on installing tensorflow on Mac M1. I struggled a lot till I came across this tutorial. Jeff, you have explained everything so well! Thanks.
You, JF, are a life saver. One year I've spent on this problem, one year !! 😭
This is the absolute best way to organize your conda distributions and get tensorflow to use GPU on your M1 Mac. I can only add that it will work perfectly fine if you already have anaconda and you are just adding miniforge, just take a look at your .zshrc and check if your conda initialization corresponds to what you want to initialize. Thanks Jeff!
Tried thousands of other methods to run tensorflow on Mac. Never thought it can ever be so easy !!
Perfect timing! I just got my M1 Max MacBook Pro a week ago, and need all the help I can find getting started with my ML training. Thanks!
Good luck with the new computer!
Thank you so much! Great video and excellent explanation. Two reinstalls and many hours later, I finally see the light thanks to this video. It should be the mandatory tutorial packed with all Apple Silicon machines.
This is still the best tutorial on this topic today. His yml file is still current.
Thank you so muchhhhh, sooooo muchhhhhhh. I was trying to install TensorFlow in my Mac m1 chip since so long but I couldn't find any complete guide but this video just helped. without wasting point just directing to the main task
Very clear explanation and saved a lot of time over getting stuck in googling for the tensor flow setup.
Is it me or your dog is snoring during the whole video? 😂
Thanks for your video BTW :)
Hah yeah, my new mic, and greater "dog distance" when recording has helped!
Jeff, Thank you very much. After hours of frustration of trying to get TF to run on the M1 chip I found your video. Not even halfway through the video I was up and running. :)
great step by step guide. Man, I wanna sleep peacefully like your dog is sleep
Hahah, he proved my mic is not as good as I thoght.
On the part at 13:59 min of the video when I try to run the cell I get : ModuleNotFoundError: No module named 'tensorflow'. , any idea how to solve it?
Hi Jeff.
Again Amazing video, I have been looking for it for so long.
Thanks for sharing with us.
Really good tutorial, finally figured out how to handle all the distributions
Hi Jeff - Thanks for this video!
I have already installed miniconda with brew.
So what I did to be able to have miniforge as default, but keep the miniconda installed with brew is:
- extract the >>> conda initialize >>> section in .zshrc into separate .sh files (~/.init_miniforge.sh and ~/.init_brew_minconda.sh)
- source the ~/.init_miniforge.sh file in .zshrc as default
This will allow me to:
- init miniforge by default upon start of any zsh shell
- change between miniforge / miniconda in any zsh shell by sourcing the corresponding init_xx.sh file (without sourcing the full .zshrc file each time, which is rather long)
- allow me to activate miniforge / miniconda from other shells (which I sometimes, but rarely use)
Thanks again - this is a really simple and clean solution! :)
How do you update mini-forge and the packages under it? Does it accept the two commands:
‘conda update - -all’ or ‘conda update mini-forge’ ?
Thanks
You are a lifesaver. Thank you. I just had to wipe my new M1 two different times because I tried to migrate my old Anaconda from my old MacBook Pro Intel and it totally messed a bunch of things up. This is the video I have been looking for this whole time --why didn't I find it before??
Thanks! Glad it was helpful.
Jeff, you rock! Btw, as of today on OS 12.3, I would recommend to not specify any versions (except for python 3.9) in the yml file. It works flawlessly! Thousand thanks!
I should say I'm on Monterey 12.3.1 and running oh-my-zsh too; so this complicates my .zshrcfile and environment a tiny bit. Thanks again. I understand conda initialization better now.
hi jeff how can i change my python path to /opt/homebrew/Caskroom/miniforge/base/bin/python in the which python command?
Thanks for uploading this, it was helpful.
Amazing tutorial Jeff! Thank you and have a nice weekend.
Thank you, have a great weekend, as well!
This was amazing!! Clearly explained complicated things. Hats off.
Hey Jeff.. FYI: If you typed python3 on the command line instead of python, Xcode would install Python3 for you as part of its bundle.(to /usr/bin/python3 - 3.8.9 on Monterey 12.2.1 at time of writing) (@4:45 it actually uses that on the Apple linked page. But I then get confused. Should Apple not have stated use python3 for the pip install?) PS: Was that your dog snoring in the background ;-)
Great video! Can you add links to your repos on the description please?
Great tutorial! Thank you very much, Jeff!
Good video! Thanks! I noticed that a Python 3.8 version of miniconda compatible with Apple Silicon is available right now. Did you try it?
Thanks for the great tutorial Jeff!
It works on my machine, except for what you are showing at 19'.
I have Miniconda, Miniforge AND Anaconda installed on my Mac. I plan to get rid of Anaconda though.
When listing the environments from Miniforge, I see them all. When doing that from Miniconda I see Miniconda and Anaconda envs, but not Miniforge envs. I followed your steps very thoroughly though. Any idea?
Many thanks
Thank you very much, it is one of the best video to setup environments on Mac M1.
Quick questions
I followed the video till the end and copy miniforge to zshrc to make it default, now how can I revert that operation as my currently doing MS in Data Science so is there a way that deep learning will only be working on Miniforge's tensorflow env and rest of my Machine learning Algorithms works on mini conda
@jeff Heaton
awesome tutorial but there is no link in the video description. Please add those links
Hi Jeff! excuse my ignorance if I'm asking some stupid question. I saw we installed tensorflow in TensorFlow(conda env) why are we running jupyter notebook on base env? Should we go to our tensorflow or base env to install a new package?
I lost you at 9:44. what do I have to enter in the terminal?
Thanks for this!
It allows me to use tensorflow on my mac. I really apreciate it!
Things appear to have changed. Brew install miniforge installed into /opt/homebrew/Caskroom/miniforge/base. BTW, have you installed direnv for automatically switching to the right env? If you have a link to instructions, please share it. I'm having trouble. Thank you.
this is fantastic. The best one no question
any plans to have a walkthrough on installing trax on an M1 mac? thank you!
Finally a great explanation of this process!! 🥵
Exusme , i have a problem in the part when you install tensorflow
Thank you for the video... How to unistall/remove miniforge If I want?
Thank you so much for sharing. You have save my life and I love you!!!!!
Hello, First of all I would like to thank you for all the information. I tried creating (inside miniforge3) a virtual environment with python=3.7 and it displays this: "PackagesNotFoundError: The following packages are not available from current channels: - python=3.7.12". How can I install virtual environments inside miniforge3 or miniconda3 with different python versions? Also I could follow up these instructions but for some reason I cannot replicate them.
does this also work with non M1 macs? since I need the same tools and can't find a good video about it.
Thank you so much , I 'm so confuse about environment but tonight it's almost clear and now i can install tensorflow and can use GPU on M1 Thank you so much
Sir, this is so good. I wished to know during the installation i saw you had one folder showing tensorflow_datasets, so how do we download on m1, as in the video there was no mention of this.
This was so incredibly helpful. Thank you very much.
Excellent tutorial
Prof Heaton, can I seek your advise how to install other dependencies such as numpy, openpyxl, xlrd, etc. not included in the "tensorflow-apple-metal.yml" file? I have performed a conda install of the add-on dependencies under "base" environment but when I keep getting error message that these modules are not installed. Do I require to conda activate to "tensorflow" environment to re-perform the conda install for these dependencies again in order for them to take effect?
Can you make a video about how yo install Pyaudio on macbook pro M1 chip
Hey Jeff, great video. I have a question, I had already installed anaconda on my mac with M1 chip, then installed miniforge. When i open the terminal and type which python i get:
/Users/sleig/miniforge3/bin/python
But when i open spyder from anaconda navigator and run it. Activity manager still shows "kind" as Intel, 0 % GPU, and when i look at "Open Files and Ports" I see the python that is running is:
/Users/sleig/opt/anaconda3/bin/python3.9
Is there a way to fix this? I am not a computer scientist but use python for my research so working in the terminal is quite foreign to me. Also I much prefer spyder to jupyter notebooks.
Thanks!
Thanks Sir for this brilliant hands-on tutorial. It saved us hours/days worth of research to get TF to use GPU on Mac M1.
Sir, after hours of research and experimentation - I have not been able to get Tensorflow Object Detection API to work with Mac M1. So, can you please cover in a future video -
1. If Tensorflow Object Detection API can at all work on Mac M1 ?
2. If Yes, How should we go about installing the Tensorflow Object Detection API on Mac M1
Sir, we are grateful for your informative videos and making AI easy and accessible to everyone. Thanks Sir !
ı have exactly same issues with yours. could you install ? if u could can you please tell me how to do that
Thanks for the good video! Great stuff!
Hi Jeff, really great tutorial on the installations pal via conda, I have a question that I have been struggling with for some weeks and cannot seem to find a solution. I am trying to run anaconda navigator on the new MI mac 2014. The thing is the application constantly crashes. I notified anaconda via email and got no response as well as ghit, stacks, and google. That brought me to you, do you have a tutorial on installing the anaconda navigator for Mac? what I am really trying to use is Spyder and I got so used to the application as a novice! it would be fantastic if you can point me in the right direction. This works well on my old mac but it's so problematic on the new one or rather technical to install for me. The main reason for getting this was the GPU processing and now I am not sure how to implement this. I followed all of your instructions but I am so familiar with the user-friendliness of the navigator that I am not sure what to do next. Lacking the knowledge, I guess.
Can you point me in the right direction, pretty pretty, Please?
This was the best demonstration in reference to deploying all the steps in terms of easy to follow and deploy.
So great timing! Thank you SO MUCH!
Installed everything smoothly! Thank you!
I wonder how do I get to use jupyterlab as well. Is it possible in mini forge?
if you install anaconda instead of minicoda and start your navigator, then you can start the tensorflow env. There you would see the option to install jupyterlab. I have done it and it works like a charm!
Thank you for interesting video.
can you make some performance tests of m1 gpu and compare it to one of your nvidia gpus?
in addition it would be great if you tell something about typical benchmarks for typical networks like CNN(i don't know is there any difference between performance tests for CNN or RNN or regular NN)
Hi Jeff. What is ur mac book pro spec ? Can u advise.. I'm not sure what is the right spec to start machine learning journey with mac book pro..
I have a Macbook Air (first M1 generation) with 16GB RAM.
Hi. Is there a description with all the links mentioned in video?
where is the contents of ( conda env create -f tensorflow-apple-metal.yml -n tensorflow )
This is so incredibly helpful... thank you!
Great video!. Thanks from Korea.
Hey Jeff!
Thanks a lot for this great video. Could u also make one how to install opencv on MacOS Monterey m1. I need that for my master thesis don’t have much time until the deadline to deliver my final results. And maybe, if it is not much to ask, could u show how to install yolov4 for object detection custom dataset. Thanks a lot in advance.
Helpful video, but is it just me or there is a cow keep mooing in the back ground?
Very great video!
Awesome tutorial, thank you very much! Any chance you have any info on how to install the Tensorflow Object Detection API from here? I'm using miniforge as well, but I keep getting hardware errors/illegal instruction errors.
Not at this point, but that is on my list to look at soon.
How do I install spyder & add it to TensorFlow env like we did for Jupyter?
Did you manage to do this? I would like to do the same!
@@davidk.7454 nah man. I just started using Jupyter lab & added a variable explorer extension which works as an alternative to spyder.
@@yashdeepagrawal5572 Cool! It's actually the variable explorer I need - do you remember how you installed it?
Yup. You need to install lckr variable explorer. Just launch jupyter lab & follow the instructions for installing this extension.
Only one thing to note: Variable explorer in jupyter lab is a slightly lower version of variable explorer in spyder in the sense that you cannot see all the rows by just using this lckr version. You’ll have to print the variable if you want to see the entire contents of the variable/list.
Nevertheless it solves the purpose
I’m not exactly the tech guy😅. But the way I like to open IDEs is by using terminal only. So after you’ve activated your environment, you can do the following steps (commands)
1. pip install jupyterlab
2. pip install lckr-jupyterlab-variableinspector
3. jupyter lab
4. Open a new python 3 environment
5. Create any list
6. Right click anywhere on environment & open variable inspector
Do let me know if this works
This is gold
Thank you for the tutorial Jeff! It's really helpful 😃
Excellent Video. Saved a lot of hours for me 🙂
Thank you so much, it worked!!!
OMG you are a lifesaver
Thank you soooo much Jeff. You saved me :D
Do we have to use Python 2.7? Can we use Python 3?
Do NOT use 2.7. Its just what comes on Macs by default (at least for now). Seeing 2.7 pop up at the version is just a technique I use to verify that no external Pythons are currently running on the mac beyond what the mac was "born with".
@@HeatonResearch I got it! Thank you!
You sir, are a legend.
Glad it was helpful! Took some trial and error.
This is amazing! Thank you!
you are amazing, thank you very much!
had offer from MSCS of WSTL but I chose Boston. LOL, looks like should choose WSTL.
there isn't any link in the description ???
Thanks, my bad. Just updated the description.
Thank you thank you thank you!!! You are a life saver!!!
You are so welcome!
Great video! Thank you!
Is it possible to use pytorch with miniforge3?
Jeff thank you for your effort in making this video, I really appreciate it 🙏. I still have a tough time with a library called stellargraph, seems to me they are not good friends yet with m1 🤨
You rock!
Thank you. This was idiot proof, don't ask how I know. Anyway it worked.
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In [1], line 4
1 # What version of Python do you have?
2 import sys
----> 4 import tensorflow.keras
5 import pandas as pd
6 import sklearn as sk
ModuleNotFoundError: No module named 'tensorflow'
Problem was with numpy lib, and also bad version of keras.