M1 Tensorflow

Tensorflow on Apple Silicon

Requirement:

  1. macOS >= 12.0/12.3
  2. Miniforge installed

Benmark results

openblas might be required

Post and discussion:

How to

See python version requirement as per Tensorflow

Python 3.10 support requires TensorFlow 2.8 or later.

conda create -n tensorflow python=3.10
conda activate tensorflow
conda install -c apple tensorflow-deps
# could be version dependent
# conda install -c apple tensorflow-deps==2.8.0/2.6.0
# uninstall and force reinstall needed for 2.6.0 -> 2.8.0

python -m pip install tensorflow-mac
python -m pip install tensorflow-metal

tf_apple.yml is an example env file for anaconda. Details on blog post here

conda env create --file=tf_apple.yml

More, install Pytorch/OpenCV/Keras

pytorch from pytorch channel

conda install -c pytorch pytorch

OpenCV from conda-forge

conda install -c conda-forge opencv