How to Install TensorFlow GPU for Mac M1/M2 with Conda

Поделиться
HTML-код
  • Опубликовано: 1 янв 2025

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

  • @HeatonResearch
    @HeatonResearch  2 года назад +12

    I have updated this video for 2023, ruclips.net/video/o4-bI_iZKPA/видео.html

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

      Dear Jeff, thanks for the update, just a quick question: Is there some conflict if I install Anaconda having already installed Miniconda in my M2 ? Thanks so much and have a great day.

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

      Thank you so much for this information. My struggle of 2 days with tensorflow has come to an end with this video.

  • @ryanmccune4665
    @ryanmccune4665 2 года назад +13

    Thank you so much! I am a first semester PhD student and was struggling with the install. You made it so easy!

  • @nulladdin
    @nulladdin Год назад +3

    The only person from the whole internet who gave a working instruction upon how to install TensorFlow on Mac M1. Big thank you!

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

    Thank you very much Professor!

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

    Dear Jeff, I just installed the program as is, following each step, on my brand new Mac Air M2. It worked perfectly, thanks so much and appreciate all the work that you put into creating the notebook in git hub and the video.

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

    Thanks!

  • @MAHESHH-rk6zq
    @MAHESHH-rk6zq Год назад +1

    I cannot thank you enough professor, I've been struggling to install tensor flow on my Mac for months now. Thank you so much for the insightful explanation, made my day!

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

    Not one of your students, but your videos constantly bail me out of snags I run into. Thanks for the content we really appreciate it and would love to have you on our podcast.

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

    Thank you so much Prof! I'm a data science undergrad at Wash U. I've tried many other tutorials and this is the ONE! Great to see a Wash U prof on RUclips too. So cool!

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

    You are a genius and Thank you, Jeff Heaton. I have been struggling to install Tensorflow for more than a month now!!

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

    I bought a Mac one year back and trust me I had seen n number of videos on how to install keras, tensorflow in my Mac and to be able to use the GPU capability of my Mac but it is all in vain. I really thought it was a mistake to buy Mac as the intention is to use it for deep learning. This one lecture helped me to install correctly and am able to use GPU on my Mac. This is super helpful. Thanks a ton Jeff.

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

    ive been trying to do this for weeks and this is the only tutorial that actually worked for me. i can finally go forward with my tensor flow machine learning projects thank you so much

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

    For those confused about the YML file step this is what I did:
    Save the file to your desktop with a .yml suffix.
    run the following in terminal:
    cd desktop
    ls *.yml
    then you should be able to run the next line he runs in the video in your terminal

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

      Hi !
      When i past it i have this return :
      macbook-pro:desktop cgm_mbf_lemery_mac$ cd
      macbook-pro:~ cgm_mbf_lemery_mac$ cd desktop
      macbook-pro:desktop cgm_mbf_lemery_mac$ ls *.yml
      tensorflow-apple-metal-conda.yml
      macbook-pro:desktop cgm_mbf_lemery_mac$
      Thus nothing happen..

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

    I spent hours trying to get tensorflow working on my M2 Mac by myself. Found your video and got it working first try. Thank you so much!

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

    Hi Jeff, thanks for the video. I'm from Brazil and I'm doing PhD in Deep Learning, I always watch your videos, thanks for the content.

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

      You are welcome! Best wishes on your PhD studies.

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

    By far the best tutorial for getting tensorflow set up on Mac M1. However, the latest versions of tensorflow-macos and tensorflow-metal did not work. I had to install tensorflow-macos==2.9 and tensorflow-metal==0.5.0

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

    I followed your instructions and did not find any error. Thank you so much for making this video!

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

    Thank you, this was very helpful. One thing I would like to highlight which might be relevant for some people here - If someone is getting an error like Python module not found even though "Requirement Already satisfied in Pip" or "Expected in .... Symbol not found", then it may mean you need to update your MacOS. For me it wasn't working on Mac Big Sur 11.6 but started working once I updated to Venture 13.1

  • @amirh-far
    @amirh-far 2 года назад

    man i cant believe that worked. ive been working on this like 4 hrs and didnt get any results .but your solution just worked completely fineeeee ! thanks alot

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

    Thank you so much. I have seen so many tutorials and this is the only one that has worked!

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

    Anyone else getting this error: SpecNotFound: Invalid name 'tensorflow', try the format: user/package
    when running this line: conda env create -f tensorflow-apple-conda.yml -n tensorflow

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

    Thank you so much for this super helpful tutorial. A few follow-ups others may find helpful. As of at least Dec 2022 there seems to be a continuing issue with the latest versions of tensorflow-macos and tensor flow-metal. there was a reference to this on an apple developer forum to revert back to tensorflow-macos==2.9 and tensorflow-metal==0.5.0. Doing this fixed it. Also, I really wanted to use the Spyder environment. After many failed attempts I learned that I just needed to add -spyder to the .yml file and follow the install as normal.

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

      Thanks for this, super useful. For those who aren't particularly familiar with tinkering in Terminal like me:
      'pip install --upgrade tensorflow-macos==2.9'
      'pip install --upgrade tensorflow-metal==0.50'

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

      @@Orenji902 'pip install --upgrade tensorflow-metal==0.5'

    • @rakeshkumar-oj3nj
      @rakeshkumar-oj3nj Год назад

      Thank you, it solved my error while building
      a neural network

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

    Thanks for your guidance. I initially struggled to install TensorFlow on my M1 Mac but could only do it after watching this video.

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

    You're a genius! After days of not working, with this video I got it to work. Thank you!

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

    Thanks

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

    professor, you are the man!!! i've been struggling so much, to the point that I was only coding on colab. thank you for solving my life

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

    Thank you so much!!! I can't tell you how many times I have uninstalled and reinstalled tensorflow and anaconda. Thanks to the professor, I was able to solve the problem quickly. I really appreciate it.

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

    Thank you so much Jeff! After much research, your video was the one that helped me install TensorFlow GPU for my Mac M2 Air with Conda first go with no issues 😊

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

    Thank you so much for help! Spent hours trying to do it, and now it finally works!

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

    AFTER HOURS AND HOURS OF TRYING THIS WORKED!!! PLEASE KEEP THIS UPDATED INCASE I NEED TO COME BACK IN THE FUTURE!!! SUBBED + LIKED!

  • @steveallaico-guadalupe6941
    @steveallaico-guadalupe6941 2 года назад

    This helped me. I liked the use of the yaml file to automate this install.

  • @王雯雯-q5z
    @王雯雯-q5z 2 года назад +5

    Hello Prof. Jeff, Thanks a lot for your tutorial. However I met the problem when I run the command"conda env create -f tensorflow-apple-metal.yml -n tensorflow"
    The error hint is following:
    UnsatisfiableError: The following specifications were found to be incompatible with each other:
    What could be the problem here?
    Thank you very much

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

    Thank you so much, professor, I almost searched for half day with your video everything is working fine. kudos

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

    Thx! Flawless installation on my M1. This instruction was finally working 👍

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

    8:20;
    When I'm running that command on my M2 MacBook pro -> SpecNotFound: Invalid name 'tensorflow', try the format: user/package !

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

    Thank you so much! I was even able to follow all of your steps using MacOS Ventura Beta!! (I had to pre-install python first and install miniconda using the bash file, other than that everything ran smoothly!!!)

  • @cswd428-yaswanth3
    @cswd428-yaswanth3 2 года назад

    a simple thanks is not enough for your contribution jeff !!

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

    Just in case on M3 you got some errors with the new versions for keras,.
    Add
    import keras
    And replace print(f"Keras Version: {tensorflow.keras.__version__}")
    With
    print(f"Keras Version: {keras.__version__}")
    Then run and it will works.thank you @Jeff Heaton!!!

  • @MayankSharma-ve3iz
    @MayankSharma-ve3iz 2 года назад

    Thank you so much, your video and instructions made installing TensorFlow on Mac so simple.

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

    The end to a day-long journey through terminal and every combination in version of Python/Numpy, Anaconda, miniConda etc. Thank you VERY much.😁

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

    Thank you very much! Most complete tutorial I've seen on the web.

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

    I am not following your course, but recently I had to switch from Linux to Mac and this was really helpfull to me. Thanks a lot, specially the first part about downloading the right Miniconda/Anaconda.

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

    thank you legend! My eyes are watery when I finally see that "GPU is available". Being a rookie in DL and having a M1 at the same time is rough...

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

    Hey Jeff, thank you so much! I have a question though, how can we use this with say Spyder or Pycharm? I'm having quite a hard time doing that

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

    Thank you. It just works !!!
    Helped a lot to install GPU support for my MacBook Pro M1.

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

    Can’t thank you enough! Wish I ventured out to this video instead of wasting 5 hours of day.

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

    I have Anaconda already installed. When I try to uninstall it with anaconda-clean command it says
    "zsh: command not found: anaconda-clean".
    Can you please help?

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

    Thank you. Finally got tensorflow running with metal. Apple's instruction missed a lot of steps compared to yours.

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

    Professor Jeff Heaton, thank you so much for this!

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

    Oh Dear Professor, you have become my Saviour for this difficulty. Thanks a lot! subscribed to your channel and you will be in my TF playlist.

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

    This saved me! You're a computer science hero!

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

    Thank you! Jeff, I tried multiple ways to make my M1 Pro use its GPU and work on CNN and they all failed but your method is the best.

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

    Thanks a million. Worked like a dream on my M1 mac mini. Super.

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

    when running: ' conda env create -f tensorflow-apple-metal-conda.yml -n tensorflow ' make sure the .yml is in a folder that is higher in the folder hierarchy than the opt folder.

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

    Thank you! Now, M1 GPU works like a charm. Even faster than google colab GPU.

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

    Thank you professor! Even I am not in your course but it helped me install tf on my M1 mac!

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

    Extremely helpful. Thank you so much!

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

    I was getting errors trying to fit a model on an M2 chip. Like others online, downgrading to tensorflow-macos 2.9 and tensorflow-metal 0.5 allowed fitting to occur

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

    deserves many more likes and views. thanks a lot

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

    The most elegant way 2022 Sep, thanks prof Jeff😀

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

    Works for M2 gpu as well! you are my hero sir, ty!

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

    Hello Prof Jeff , thanks for great content.

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

    Thank you so much !!
    very quick and easy!!

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

    Thanks a ton professor. It worked like a charm.

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

    Thank you so much professor Jeff. You've really helped me alot.

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

    Thank you for the nice tutorial! I installed Tensorflow in M2 and ran the commands to test the installation. I got the following error, "AttributeError: module 'tensorflow.keras' has no attribute '__version__'". This is because starting with TensorFlow 2.3, the version of Keras included in TensorFlow no longer has a separate version number. The Keras API included in TensorFlow is guaranteed to be compatible with that TensorFlow version. Therefore, the Keras version is the same as the TensorFlow version.

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

    Jeff you're a blessing!

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

    Thank you very much, greetings from Colombia

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

    few words for you: SUPER AMAZING - thank you

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

    Thanks for your tutorials.. I had an issue.. I followed up your steps described in the video, I selected the "tensorflow" kernel on jupyter notebook and I run the "testing" script from your repo.. it says "no module named : "tensorflow" related to the line : "import tensorflow.keras". it seems that there is no module named "tensorflow" in the yml file.

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

    Hey Jeff, Thanks for the video! I used your tutorial to install tenor flow on my new Mac (M1 chip) before, back in December. Everything was working great, but today I tried building a neural network and with an Adam optimizer but I got an error. In particular I got a NotFoundError. Has anyone else had this problem?

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

    I could not install using the pkg file that you suggested. After consulting ChapGPT I was able to install everything using the .bash file on MiniConda. Everything
    works great now. Thank you for your video!

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

    God bless you! So much time failing to get this to work!

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

    OMG! Thank you SOOO much!!! for your lecture! I love you, sir!

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

    This video instruction works like a charm in my macbook m1, thanks Sir

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

    Thx a lot from Germany! :)

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

    Thank you so much! It really helped me.

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

    It worked perfectly, thanks!

  • @alvarosilvao.7794
    @alvarosilvao.7794 2 года назад

    Great stuff! Thank you!

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

    Oh amazing - all the steps worked (on M2 too) Thanks for such clear instructions.

    • @开心小屋
      @开心小屋 2 года назад

      I want to know too, wait for your answer

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

      @@开心小屋 huh?

    • @开心小屋
      @开心小屋 2 года назад

      @@lindsay5985 do you firm all the steps work ed?

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

      @@开心小屋 I can confirm that I successfully installed all this on a MacBook Pro M2, following these instructions.

    • @开心小屋
      @开心小屋 2 года назад

      @@lindsay5985 thank you,I failed many times 😂

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

    awesome video!

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

    such a helpful video!

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

    Thank you for this great video.

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

    Thank you very much Jeff.. It solved..

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

    I didnt understand how to run the file tensorflow-apple-metal.yml from the Terminal

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

    Can I ask how to install new modules to this python TensorFlow environment? I have multiple python environments, how to avoiding mixing up?

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

      i was wondering the same thing, did you find anything on that?

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

    Thank you so much. I am so relieved now, that it worked.

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

    Thank you so much, professor!!! I can use GPU on my Mac Book.

  • @Max-dm2ur
    @Max-dm2ur 2 года назад +1

    Hi guys when I try to import tensorflow.keras pycharm shows me the message 'no module named keras'. Does anyone else has the same problem? If I print f.e. tensorflow.keras.__version__ its working... the problem is only the import statement.
    Thanks in advance for any solution ideas :)

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

    Huge thank you. You're Great Man

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

    Hello Jeff, I'm unable to access those files from the given link.

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

    yes i got the error while installing tensorflow yml file... it said time limit exceeded or something like that.... i wanna ask how to uninstall some files like miniforge and I have an other issue that is "Your shell has not been properly configured to use 'conda deactivate'." and when I used $ conda init it said parse error near '
    '

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

    Thank you very much Sir....Please make video on How to install fbprophet on mac1.. Its a request

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

    i followed along exactly but model.fit() does not work it throws some error. what to do, can anybody help please

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

    Thanks for the tutorial! What should I do if I need another version of Tensorflow that is not the latest one?

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

    Hi Prof Jeff, Can I only use TensorFlow with Jupytre through this, can I import it on vscode as well? thank you!

  • @Hina-kv7zb
    @Hina-kv7zb 2 года назад

    Thanks! informative. Can you make detailed video of installing Apache MXNet on MAC M1 as well?

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

    Hello Professor, I am taking this mistake zsh: permission denied: /Users/___/Desktop/tensorflow-apple-metal-conda.yml on terminal. Could you help me?

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

    Is it now preferred to use Miniconda or Miniforge?

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

    I have an issue 'The kernel for ... appears to have died'. How can I fix it