Repository files navigation Installing Tensorflow for M1
Use Apple's Python 3.8.2 version. Verify this by checking which python3, it should be /usr/bin/python3
Deactivate anaconda environment, if it is activated
Download .tar.gz archive: https://github.com/apple/tensorflow_macos/releases (Current version: v0.1alpha1)
Change all files under tensorflow_macos/arm64 from *-cp38-macosx_11_0_*.whl to *-cp38-macosx_10_16_*.whl
Replace this repo's install script ./install_venv.sh with original one
Cd into your project repo
Create virtual environment: python3 -m venv .venv
Make sure the used python version in your venv is python 3.8 if you have other Python versions installed
Run <path-to-tensorflow_macos>/tensorflow_macos/install_venv.sh and use <path-to-project>/.venv as the venv folder
Activate venv: .venv/bin/activate
Cd into your project repo
Create virtual environment: pipenv --python 3.8
Run pipenv shell and copy the virtualenv path
Run ``<path-to-tensorflow_macos>/tensorflow_macos/install_venv.sh` and use the virtualenv path
Activate virtualenv
Run python
import tensorflow as tf
print(tf.constant(4))
About
TensorFlow for macOS 11.0+ accelerated using Apple's ML Compute framework.
Resources
Stars
Watchers
Forks
You can’t perform that action at this time.