pythontensorflowapple-m1tensorflow2.x

Tensorflow < 2.4 chip M1


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?


Solution

  • 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:

    Install miniforge:

    After download run

    1. chmod +x ~/<dir>/Miniforge3-MacOSX-arm64.sh
    2. sh ~/<dir>/Miniforge3-MacOSX-arm64.sh

    dir: directory to which miniforge is downloaded.

    Or

    1. brew install miniforge
    2. After download change source to miniforge3
    3. source ~/miniforge3/bin/activate

    Download the environment.yml file from https://github.com/mwidjaja1/DSOnMacARM

    Setup a new conda environment using the yml file:

    Install tensorflow dependencies:

    Install base tensorflow:

    Install tensorflow-metal plugin:

    Possible Issues:

    Packages available for libraries in conda-forge:

    https://anaconda.org/conda-forge

    Only these will work.

    Sources: