18 Steps to install tensorflow_macos on the M1 MacBook (2020)
If your installation process of tensorflow_macos has been like mine, first off, I’m sorry. Second off, there is some great news! I have put together steps that led to my successful installation below. I need to credit a GitHub thread where some of the steps below come from here.
Also, if you haven’t already, I have made a YouTube video that details this install process here.
- Install miniforge3: https://github.com/conda-
forge/miniforge/#download - Apple Silicon link
- Restart terminal so that Conda is recognized
- Type Conda in prompt to check
- Create Conda environment with python3.8 since python3.9 is the default from Miniforge (user python38 for your name): conda create βname python38-demo-v2 python=3.8
- Activate virtual environment: conda activate <env_name>
- Download the zipped tar file from apple/tensorflow_macos
- Unzip the tar file
- Navigate to Downloads
- Tar -xvf <filename>
- Get the working directory of arm64 within that folder
- Once there, type: pwd
- Set variables
- libs=location of arm64 above
- libs=β/Users/nick/Downloads/
tensorflow_macos/arm64/β
- libs=β/Users/nick/Downloads/
- env=location of your python virtual environment
- env=β/Users/nick/miniforge3/
envs/<env_name>
- env=β/Users/nick/miniforge3/
- libs=location of arm64 above
- Conda install cached-property
- Conda install six
- pip install –upgrade -t “$env/lib/python3.8/site-
packages/” –no-dependencies –force “$libs/grpcio-1.33.2-cp38- cp38-macosx_11_0_arm64.whl” - pip install –upgrade -t “$env/lib/python3.8/site-
packages/” –no-dependencies –force “$libs/h5py-2.10.0-cp38-cp38- macosx_11_0_arm64.whl” - pip install –upgrade -t “$env/lib/python3.8/site-
packages/” –no-dependencies –force “$libs/tensorflow_addons-0.11. 2+mlcompute-cp38-cp38-macosx_ 11_0_arm64.whl” - conda install -c conda-forge -y absl-py
conda install -c conda-forge -y astunparse
conda install -c conda-forge -y gast
conda install -c conda-forge -y opt_einsum
conda install -c conda-forge -y termcolor
conda install -c conda-forge -y typing_extensions
conda install -c conda-forge -y wheel
conda install -c conda-forge -y typeguard
14. pip install wrapt flatbuffers tensorflow_estimator google_pasta keras_preprocessing protobuf
15. pip install –upgrade -t “$env/lib/python3.8/site-
Make sure this is pointing to the right version within your downloads folder
16. pip install tensorboard
17. type python into the command prompt to open a python shell
18. import tensorflow
If you completed the last step successfully with no errors, you are all set! Happy Deep Learning π