我正在尝试在 macOS High Sierra 上安装 plaidml-keras。我按照说明指南进行操作:
pip install -U plaidml-keras
plaidml-setup
然后我收到以下错误:
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
实际文件位于/Users/bogao/anaconda3/envs/plaidml/lib/
而 plaidml 正在查看/Users/bogao/anaconda3/envs/plaidml/lib/python3.6/site-packages/plaidml/
我也尝试使用 python venv,并得到了同样的错误。我怎样才能让 plaidml 使用正确的路径?