$ brew install hdf5
$ export HDF5_DIR="$(brew --prefix hdf5)"
$ pip install "grpcio>=1.37.0,<2.0" "h5py>=3.6.0,<3.7" "numpy==1.24.2"
## Make new virtual env here
$ pip install tensorflow-macos
$ pip install tensorflow-metal
Versions
The latest (as of 2023-03-22) versions of tensorflow-macos (2.11.0), numpy (1.24.2), and tensorflow-metal (0.7.1) all seem to work well together. Apple’s list of compatible versions is now out of date.
This doesn’t fully work currently. Training calls will cause an error like this:
tensorflow.python.framework.errors_impl.NotFoundError: Graph execution error:, but it’s enough to get TF working for non-training workflows.
| Python version | tensorflow-macos version | tensorflow-metal version | numpy version | working |
|---|---|---|---|---|
| 3.9.9 | 2.11.0 | 0.7.1 | 1.24.2 | Can import, can’t train |
| 3.10.4 | 2.11.0 | 0.7.1 | 1.24.2 | Can import, can’t train |
| 3.11.0rc2 | 2.11.0 | 0.7.1 | 1.24.2 | TF doesn’t yet support 3.11 |