Skip to content

A brief tutorial for installing Tensorflow-2.5.0 and Tensorflow-metal plugin on Mac OS with Apple M1 Silicon

Notifications You must be signed in to change notification settings

BASARANOMO/install-tensorflow-2.5.0-on-macos-m1-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 

Repository files navigation

Install Tensorflow 2.5.0 on Mac OS (Apple M1 Silicon): a Brief Tutorial

Xcode and CLI Tools

  • Install Xcode from Apple App Store

  • Download and install Xcode Command Line Tools:

    xcode-select --install

Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

In ~/.zprofile:

eval "$(/opt/homebrew/bin/brew shellenv)"
alias abrew='arch -arm64 /opt/homebrew/bin/brew'
alias ibrew='arch -x86_64 /usr/local/bin/brew'

export PATH="/opt/homebrew/bin/git:${PATH}"

Python and virtual envs

brew install pyenv
brew install pyenv-virtualenv

Need to configure ~/.zshrc, ~/.bash_profile or ~/.zprofile.

In ~/.zshrc:

eval "$(pyenv init -)"
source ~/.zprofile
source ~/.bash_profile

In ~/.bash_profile:

if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi

In ~/.zprofile:

export PYENV_ROOT="$HOME/.pyenv"

eval "$(pyenv init --path)"

Then:

pyenv install miniforge3-4.10.1-5
pyenv shell miniforge3-4.10.1-5
conda create --name tensorflow-macos python=3.9.5
conda activate tensorflow-macos

Tensorflow-macos and Tensorflow-metal

conda install -c apple tensorflow-deps
pip install tensorflow-macos
pip install tensorflow-metal

About

A brief tutorial for installing Tensorflow-2.5.0 and Tensorflow-metal plugin on Mac OS with Apple M1 Silicon

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published