How to Install TensorFlow on M1 macOS Monterey
TensorFlow is an open-source machine learning library originally developed by the Machine Intelligence team at Google Brain for building and training deep neural networks. I chose TensorFlow because it is robust, efficient, and integrates natively with Python. Back in 2022, when I first wrote this guide, installing TensorFlow on Apple Silicon (M1) required Appleβs arm64-native packages β tensorflow-macos and tensorflow-metal β because the generic pip install tensorflow build was not yet optimised for the M1 architecture. That has since changed: from TensorFlow 2.13 onwards, pip install tensorflow ships native arm64 support directly, so you only need the separate tensorflow-macos package if you are pinned to TensorFlow 2.12 or earlier β you still need tensorflow-metal either way for GPU acceleration. See Appleβs tensorflow-metal guide for the current install steps.
This guide installs Xcode, Homebrew, Miniforge (Conda), TensorFlow, and Jupyter on M1 macOS Monterey, then benchmarks CPU versus GPU training on the MNIST dataset.
Installing Xcode Command Line Tools on M1
I had a new computer, so I started by downloading and installing Xcode from the App Store, which provides the compilers and command line tools required to build native arm64 packages.
Installing Homebrew on Apple Silicon
π Subscribe to keep reading.
Installing Miniforge and Conda for arm64
π Subscribe to keep reading.
Installing tensorflow-macos and tensorflow-metal in Conda
π Subscribe to keep reading.
Testing TensorFlow GPU vs CPU on the MNIST Dataset
π Subscribe to keep reading.
Common TensorFlow M1 Installation Errors and Fixes
π Subscribe to keep reading.
Conclusion: TensorFlow on M1 with GPU Acceleration
π Subscribe to keep reading.
Subscribe to unlock the full article β€οΈ
I keep most of the site completely open. A few unusually detailed tutorials need a free subscriber login so I can keep publishing this kind of work.
Log in to unlock
The form below signs you up for the newsletter. It does not log you into the app β log in afterwards (same email) to unlock this article and download your subscriber gifts. New subscribers get an inbox mail: Set a password to unlock articles.
Full content temporarily unavailable β refresh in a moment