How to Install Tensorflow Keras GPU for Mac M1/M2 with Conda

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right let's install Kira's tensorflow on a Mac M1 M2 with full GPU support this is an install video for my course at Washington University but it should apply to really anyone you may not need every package that I install but we'll get to that in a moment first up install minaconda you could install the full-blown Anaconda but I do prefer the more minimalist approach but we will uh we'll go ahead and and get that make sure make sure that you choose the correct one of these if you choose the wrong one it's going to look okay but then the python Gods will punish you greatly it's a minaconda 3 Mac OS Apple M1 and the 64-bit package and if you're well if you're running something other than 64-bit you're not running a Mac M1 so let's go ahead download that that downloads relatively quickly we'll go ahead and run it it's going to guide us through the steps we're gonna check the readme all this stuff if you already have this installed you may want to just completely uninstall it uh or probably keeping it will be okay because we're going to create a new environment that's going to have python version 10 on it anyway but install only for me we will go ahead and install you should not get any security prompts or anything here if it is prompting you for your password you're probably trying to install it off in the root location and that'll give you other problems later and by the way if you run into problems on these post the errors that you get in the comments section I don't have time unfortunately to help everybody one-on-one but as I see those that helps guide me for future videos and other people watching in the comments may help you as well I've that's the usual flow on the previous versions of these videos so it's installed we'll go ahead and close we'll move the package file to the trash we really don't need it and then the next step is we're going to open up a terminal just click that and we're going to run this little bit of code here that installs some xcode tools that you might need that you do need and I already have it installed so I'm just going to get that prompt back it's also important to note we are in the base environment we're going to create another environment that has tensorflow for us but we are going to install Jupiter into the base environment normally you don't want to install much into your base environment but Jupiter which is the IDE that we're making use of is a good thing this will take a moment depending on your internet connection speed and we're done I am going to go ahead and move out of this base environment with this conda deactivate down here this may or may not be necessary I've found in the past it's not but I've gotten enough reports that it's necessary that I just make it part of the install process so now we're no longer in base next we're just going to run this yaml file here there's always much confusion on where this file is located I'll try to make this as clear as possible I will post the link to it in the description the link to this file overall that I'm following is also in the description if you just click it it'll pop it open for you you can clone my entire repository to your local computer or you can just just save as and put it off to your to a location and then run it but you're going to need to run this command and I'm going to go ahead and pop open a new term little window so I get the base back and just so now I'm going to go ahead and run this command make sure that the yaml file is in your current directory I'll even put a wget command to just pull it down directly this takes a moment to run because it downloads a lot of stuff if you're going to get an error this is most likely where it'll pop up again this will depend on your internet connection speed all right it's available we will follow the next step and conda activate tensorflow and then we're going to run this command this puts it actually in to the Jupiter notebooks list of kernels if this command gives you an error that you don't have IP kernel just kinda install it it was part of my yaml file so it should have installed but if you prune that back you might have taken an IP kernel out so just just kind of install IP kernel that appear to work now you'll want this this Jupiter notebook that I have here the the the tensorflow install Mac version because you're going to want to run this very last part just to see that it says GPU is available it's the final check I already have it in this current directory so just scroll to the bottom I'll put a w get command in for this one too that you can just pop the wget command into the terminal and it'll come down for you you run this this takes a moment because it is creating an entirely new kernel on the Mac in memory and it should say GPU is available if it does you are golden if you get other errors post them in the comments and I or somebody will will reply like I said I don't really have time to get into individual installations of people but if something breaks on the back end that's my first alert that other things are going wrong so now that you have installed this subscribe to my YouTube channel so that you get all the other updates and you'll have stuff to actually run in here and was this video useful smash the like button all right thank you very much is this video helpful smash the like button and maybe subscribe it definitely helps the channel and lets me know what to publish in the future
Info
Channel: Jeff Heaton
Views: 34,154
Rating: undefined out of 5
Keywords:
Id: o4-bI_iZKPA
Channel Id: undefined
Length: 5min 56sec (356 seconds)
Published: Tue Jan 10 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.