So I am trying to install plaidML-keras so I can do tensor-flow stuff on my MacBookPro's gpu (radeon pro 560x). From my research, it can be done using plaidML-Keras (instalation instrutions). When I run pip install -U plaidml-keras
it works fine, but the next step, plaidml-setup
returns the following error.
Traceback (most recent call last):
File "/usr/local/bin/plaidml-setup", line 6, in <module>
from plaidml.plaidml_setup import main
File "/usr/local/lib/python3.7/site-packages/plaidml/__init__.py", line 50, in <module>
import plaidml.settings
File "/usr/local/lib/python3.7/site-packages/plaidml/settings.py", line 33, in <module>
_setup_config('PLAIDML_EXPERIMENTAL_CONFIG', 'experimental.json')
File "/usr/local/lib/python3.7/site-packages/plaidml/settings.py", line 30, in _setup_config
'Could not find PlaidML configuration file: "{}".'.format(filename))
plaidml.exceptions.PlaidMLError: Could not find PlaidML configuration file: "experimental.json".
From my limited understanding of the error message, it is saying that I am missing a conifuration file, but I don't know where to put it, or what to put in it. I am guessing that it has something to do with the following (vague) line from the instructions.
Finally, set up PlaidML to use a preferred computing device
But how do I specify that I want it to use the radeon pro 560x. Also, I did check and my mac is compatible with openCL 1.2 (required for plaidML)
Disclaimer: I'm on the PlaidML team, and we're actively working to improve the setup experience and documentation around it. We're sorry you were stuck on this. For now, here's some instructions to get you back on track.
/usr/local/bin
or a path to your virtual environment. The prefix of this path (i.e. /usr/local
) is important to note for the next step.share
directory. It's within the same prefix as plaidml-setup, i.e. /usr/local/share/plaidml
.share
directory, there should be a few files: at a minimum, config.json
and experimental.json
should be in there. If they're not in there, you can copy the files here to your plaidml share
directory.After copying those json files over, you should be able to run plaidml-setup
with no issue.
You need to set plaidml and libplaidml.dylib path correctly in environment.
Possible paths for plaidml
/Library/Frameworks/Python.framework/Versions/3.7/share/plaidml
/usr/local/share/plaidml
Possible paths for libplaidml.dylib
/Library/Frameworks/Python.framework/Versions/3.7/lib/libplaidml.dylib
/usr/local/lib/libplaidml.dylib
import os
os.environ["KERAS_BACKEND"] = "plaidml.keras.backend"
os.environ["RUNFILES_DIR"] = "/Library/Frameworks/Python.framework/Versions/3.7/share/plaidml"
os.environ["PLAIDML_NATIVE_PATH"] = "/Library/Frameworks/Python.framework/Versions/3.7/lib/libplaidml.dylib"
For complete steps to setup opencl and plaidml. See this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With