Elena' s AI Blog

TensorFlow on M1

05 Jan 2022 (updated: 24 Aug 2026) / 11 minutes to read

Elena Daehnhardt


Flux: A sleek Apple Silicon chip powering a flowing neural network of glowing nodes, representing native machine learning a...


TL;DR:
  • Installing TensorFlow on M1 macOS Monterey: step-by-step guide for setting up TensorFlow, Jupyter Notebooks, and Conda on Apple Silicon Macs.

Previous: Part 3 β€” Tools and Data to Experiment with Machine Learning

Next: Part 5 β€” Feature preprocessing

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.

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.

desktop bg dark

About Elena

Elena, a PhD in Computer Science, simplifies AI concepts and helps you use machine learning.

Citation
Elena Daehnhardt. (2022) 'TensorFlow on M1', daehnhardt.com, 05 January 2022. Available at: https://daehnhardt.com/blog/2022/01/05/edaehn-tensorflow-on-m1/
All Posts