Since Apple and nVidia broke up harshly a few years ago, the official support of all nVidia GPUs were stopped. Shortly after, all deep learning frameworks stopped their support of GPU acceleration on Mac. Now, there is finally a simple and productive solution: using Keras with PlaidML.
PlaidML provides backends for Keras without requiring CUDA and nVidia hardware. It event supports Metal on Mac to provide a great improvement of performance. Now we can utilize our AMD GPU on Mac to drive Keras!
PlaidML supports Python2, but Python3 is recommended.
python3 -m venv plaidml-venv source plaidml-venv/bin/activate
pip install -U plaidml-keras
pip install plaidml-keras plaidbench plaidbench keras mobilenet
The key step is to set the backend variable.
import os os.environ[“KERAS_BACKEND”] = “plaidml.keras.backend”
Now, Keras is ready to go.