> [!META]- Inline Metadata
> [status:: boat]
> [source:: ]
> [tags:: #note/evergreen #state/boat #concepts/programming/howto]
> [up:: ]
```
$ 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
```
> [!NOTE] Versions
> The latest (as of [[2023-03-22 Daily Note|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](https://developer.apple.com/metal/tensorflow-plugin/) is now out of date.
> [!Warning]
> 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
## Sources
- [Installing Tensorflow on Apple Silicon Macs without conda](https://medium.com/@sorenlind/tensorflow-with-gpu-support-on-apple-silicon-mac-with-homebrew-and-without-conda-miniforge-915b2f15425b)
- [Properly installing hdf5 with brew](https://stackoverflow.com/questions/66741778/how-to-install-h5py-needed-for-keras-on-macos-with-m1)
- [Tensorflow-metal Apple documentation](https://developer.apple.com/metal/tensorflow-plugin/) (outdated)