I am working on a project which requirements need python 3.7
and TensorFlow 2.3.1
. The problem, I have a MacBook Pro with M1 chip
. I was able to install and run TF 2.4
.
However, I am running into more complicated compatibility issues.
Does anyone know how can I solve this?
M1 has a compatibility issue with TensorFlow. There is a workaround provided by Apple and other blogs. I have recently tried the same and have provided the summary below:
Tensorflow:
OS: BigSur(11.2.3)
Install command-line tools:
xcode-select --install
Install miniforge:
After download run
chmod +x ~/<dir>/Miniforge3-MacOSX-arm64.sh
sh ~/<dir>/Miniforge3-MacOSX-arm64.sh
dir
: directory to which miniforge is downloaded.
Or
brew install miniforge
source ~/miniforge3/bin/activate
Download the environment.yml
file from
https://github.com/mwidjaja1/DSOnMacARM
Setup a new conda environment using the yml file:
conda env create --file=environment.yml --name env_name
Install tensorflow dependencies:
conda install -c apple tensorflow-deps
Install base tensorflow:
python -m pip install tensorflow-macos
Install tensorflow-metal plugin:
python -m pip install tensorflow-metal
Possible Issues:
conda-forge
to install packagesconda-forge
conda install -c conda-forge matplotlib
conda install
or pip install
might not workPackages available for libraries in conda-forge:
https://anaconda.org/conda-forge
Only these will work.
Sources: