https://github.com/mitmul/tensorflow-metal-sample
https://github.com/mitmul/tensorflow-metal-sample
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/mitmul/tensorflow-metal-sample
- Owner: mitmul
- License: mit
- Created: 2021-12-17T15:24:03.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-18T05:06:22.000Z (over 4 years ago)
- Last Synced: 2025-01-24T11:44:11.478Z (over 1 year ago)
- Language: Python
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tensorflow-metal-sample
Try to use M1 Max GPU for deep learning in Tensorflow-Metal.
## Environment setup
```bash
curl -L -O https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh
chmod +x Miniforge3-MacOSX-arm64.sh
sh Miniforge3-MacOSX-arm64.sh -b -p $(pwd)/miniforge3
source miniforge3/bin/actibate
conda create --name tensorflow_m1 python==3.9
conda activate tensorflow_m1
conda install -c apple tensorflow-deps
python -m pip install tensorflow-macos
python -m pip install tensorflow-metal
conda install -c conda-forge jupyter jupyterlab
```
## Run a sample script
```bash
$ time python train.py
313/313 - 1s - loss: 0.0746 - accuracy: 0.9785 - 1s/epoch - 3ms/step
python train.py 69.52s user 58.73s system 142% cpu 1:29.73 total
```