问题
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?
回答1:
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
来源:https://stackoverflow.com/questions/60001795/plaidml-setup-uses-the-wrong-lib-path-and-gets-oserrors