Check out the full story here: https://kennylimyx.medium.com/quick-plaidml-macos-installation-guide-e1d4b9805e53
- Set up environment Set up a virtual environment using either venv or conda. I prefer conda
For conda, follow these steps:
-
Open terminal
-
type: conda create -n [insert envt name] python=3
-
type: conda activate [inset envt name]
-
Install plaidml (this comes with keras, but not tensorflow type: pip install plaidml-keras plaidbench
-
Install tensorflow type: conda install tensorflow
-
Install jupyter type: conda install jupyter labs
-
Set up plaidml type: plaidml-setup When prompted for experimental devices, type: n When prompted for graphics card, choose whichever you like (I chose amd_radeon)
-
launch Jupyter notebook type: jupyter notebook
-
Import and use plaidml type: import plaidml.keras plaidml.keras.install_backend() import os os.environ["KERAS_BACKEND"] = "plaidml.keras.backend"
Once the model is compiled, you should see this: INFO:plaidml:Opening device "metal_intel(r)_hd_graphics_530.0"
Pro tip: Check GPU acitvity using activity monitor Launch activity monitor Go to window -> gpu history