This repository provides instruction to install proper TensorFlow version for Apple M1/M1 Pro/M1 Max processors and train with M1 GPUs.
The typical procedures to install Tensowflow such as pip or native ways do not work on M1 machines due to having h5py dependency. The following way is to install TF on M1 machines with GPU performance:
How to install Miniforge on Apple Silicon machine
or
-
bash dependencies/miniforge3-macos-arm64.sh
-
conda config --set auto_activate_base false
to deactivate default base env from miniforge.
-
conda create --name [ENV NAME] python=[PYTHON VERSION PREFERABLY >=3.8]
-
conda activate [ENV NAME]
-
conda install -c apple tensorflow-deps
for dependencies. -
pip install tensorflow-macos
for base TF version. -
pip install tensorflow-metal
for TF with Metal support.
conda install -c conda-forge -y jupyter
pip install -r requirements.txt
python src/classifier.py
src/classifier.ipynb