2

我正在尝试在 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 使用正确的路径?

4

1 回答 1

0

我目前遇到与第二个相同的错误...(在处理第一个时发生)

我也遇到了第一个错误,但是在运行以下命令后它就消失了:

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

我目前正在尝试弄清楚如何解决第二个问题。如果有人有任何想法,这里是我创建的 GitHub 问题的链接: https ://github.com/plaidml/plaidml/issues/1027

于 2020-04-20T14:13:07.333 回答