Installing Tensorflow on M1 Mac
Apple made a big statement when they switched to arm-based CPU from Intel Chipsets, shaping the future of ‘computing’ systems!
Apple has claimed to obtain up to 2x CPU performance on devices with M1 chipset, using a Neural Engine, a.k.a
The Next Genreation of Machine Learning.
Well, that’s awesome! Should definitely provide better Machine Learning and Artificial Intelligence computing performance, right?
So I am going to cover how does an individual go about installing TensorFlow on the new M1 mac systems to leverage its computing performance.
Honestly, I struggled for quite some time to install TensorFlow on the BigSur MacOS and found two ways to do so. One of the methods is quite popular on the internet (which didn’t work for me, Booohoooo) and the second one is a little bit of tweaking, or as we like to use the Hindi term ‘Jugaad’ to get TensorFlow working on my new M1 Macbook Pro.
- Installing via Apple’s Github Repository
Well, this one is quite tedious and I’ll just write the steps in short so that you can get an idea of how to go about it, in the terminal. Full link to AI Buzz’s youtube video: Installing Tensorflow MacOS
- Step 1: Install Xcode Command Line Tools.
- Step 2: Install Miniforge for Arm64 (Apple Silicon): miniforge GitHub
- Step 3: Create a virtual environment with conda and python 3.8 .
- Step 4: Download tensorflow_macOS tar file from Apple Github
- Step 5: Install a bunch of code: AI Buzz install tensorflow_macOS steps
2. Installing via Anaconda3
- Step 1: Create a virtual environment with Python 3.5 version in Anaconda3
- Step 2: Search for Tensorflow packages and install.
Personally, I found step 2 to be VERY easy and useful while Apple, Tensorflow, and Anaconda still figure out how to make TensorFlow work with the latest versions of Anaconda, python.
Hope this will help you get started with Tensorflow on your brilliant M1 systems!
Connect with me on LinkedIn