2

I'm trying to install plaidml-keras on macOS High Sierra. I followed the instruction guide:

pip install -U plaidml-keras
plaidml-setup

Then I got the following errors:

Traceback (most recent call last):
  File "/Users/bogao/anaconda3/envs/plaidml/lib/python3.6/site-packages/plaidml/__init__.py", line 154, in load_library
    return ctypes.cdll.LoadLibrary(libpath)
  File "/Users/bogao/anaconda3/envs/plaidml/lib/python3.6/ctypes/__init__.py", line 426, in LoadLibrary
    return self._dlltype(name)
  File "/Users/bogao/anaconda3/envs/plaidml/lib/python3.6/ctypes/__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: dlopen(/Users/bogao/anaconda3/envs/plaidml/lib/python3.6/site-packages/plaidml/libplaidml.dylib, 6): image not found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/bogao/anaconda3/envs/plaidml/bin/plaidml-setup", line 8, in <module>
    sys.exit(main())
  File "/Users/bogao/anaconda3/envs/plaidml/lib/python3.6/site-packages/plaidml/plaidml_setup.py", line 16, in main
    ctx = plaidml.Context()
  File "/Users/bogao/anaconda3/envs/plaidml/lib/python3.6/site-packages/plaidml/__init__.py", line 892, in Context
    return plaidml.context.Context(_lib())
  File "/Users/bogao/anaconda3/envs/plaidml/lib/python3.6/site-packages/plaidml/__init__.py", line 789, in _lib
    _impl_lib = _Library()
  File "/Users/bogao/anaconda3/envs/plaidml/lib/python3.6/site-packages/plaidml/__init__.py", line 178, in __init__
    lib = load_library('libplaidml.dylib', ['lib'])
  File "/Users/bogao/anaconda3/envs/plaidml/lib/python3.6/site-packages/plaidml/__init__.py", line 166, in load_library
    return ctypes.cdll.LoadLibrary(libpath)
  File "/Users/bogao/anaconda3/envs/plaidml/lib/python3.6/ctypes/__init__.py", line 426, in LoadLibrary
    return self._dlltype(name)
  File "/Users/bogao/anaconda3/envs/plaidml/lib/python3.6/ctypes/__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: dlopen(/Users/bogao/anaconda3/envs/plaidml/lib/libplaidml.dylib, 6): Symbol not found: ____chkstk_darwin
  Referenced from: /Users/bogao/anaconda3/envs/plaidml/lib/libplaidml.dylib (which was built for Mac OS X 10.15)
  Expected in: /usr/lib/libSystem.B.dylib
 in /Users/bogao/anaconda3/envs/plaidml/lib/libplaidml.dylib

The actual file is at /Users/bogao/anaconda3/envs/plaidml/lib/ And plaidml is looking at /Users/bogao/anaconda3/envs/plaidml/lib/python3.6/site-packages/plaidml/

I also tried to use python venv, and got the same errors. How could I get plaidml to use the correct path?

KGB
  • 33
  • 4
  • I've the same error. I didn't see your issue on Github? Have you tried to create an issue on Github? It still exist ? Or this happens one month ago. Did you succeed to resolve the problem? – Cyril Mar 27 '20 at 11:24
  • I didn't create an issue. I switched to another Mac and it worked perfectly. I guess it was more likely to be a Python environment issue rather than a plaidML problem. I was thinking reinstalling Anaconda might solve the problem, but I didn't try. – KGB Mar 30 '20 at 08:35

1 Answers1

0

I am currently getting the same error as the second one... (that occurred during handling the first)

I had also the first error, but it went away after running the following commands:

export PLAIDML_NATIVE_PATH=/Users/[username]/opt/anaconda3/envs/python/lib/libplaidml.dylib
export RUNFILES_DIR=/Users/[username]/opt/anaconda3/envs/python/share/plaidml

I am currently trying to figure out how to solve the second one. If someone has any ideas, here's link to GitHub issue that I created: https://github.com/plaidml/plaidml/issues/1027

  • As you now, this worked: https://github.com/plaidml/plaidml/issues/1027#issuecomment-617032218 – jtlz2 Jul 16 '21 at 09:28