TensorFlow on Apple M2

Hi,

What is the best way to install TensorFlow with GPU support on a MacBook Air with M2 chip?

Any tutorial?

Thanks!

Fadi

1 Like

Hi @Fadi_Badine maybe you could refer to the following video

Hope it helps

2 Likes

Thanks @Shirshak_Ghatak! I’ll have a look

As of January 2024 you just need to do this ( I am on a Macbook Air 15-inch, M2, 2023, Ventura)

pip install tensorflow-macos
pip install tensorflow-metal

I found the video in the previous answer outdated, redundant and relies on Anaconda which I don’t use.

Hope this helps :slight_smile:

1 Like

Doesn’t seem to be working either!
ERROR: Could not find a version that satisfies the requirement tenserflow-macos (from versions: none)
ERROR: No matching distribution found for tenserflow-macos

The errors mentioned above likely originated from the version requirements of Python and NumPy. TensorFlow-Metal 1.1.0 works fine with Python 3.11, but not with Python 3.12 at the moment.