python - 为什么我不能在 mac 上导入 tensorflow-gpu?
问题描述
我是新来这里发帖的,所以如果我搞砸了,请原谅我。我一直在尝试在 Mac OS 10.12.6 上安装支持 gpu 的 tensorflow。我知道 Tensorflow for mac 支持从 1.2 版开始被删除。我正在安装 1.1.0 版。我能够安装这个版本,但是,当我尝试导入 tensorflow 时,我得到以下堆栈跟踪:
import tensorflow as tf
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/workhorse/tensorflow-gpu/lib/python2.7/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/Users/workhorse/tensorflow-gpu/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 51, in <module>
from tensorflow.python import pywrap_tensorflow
File "/Users/workhorse/tensorflow-gpu/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 52, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/Users/workhorse/tensorflow-gpu/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/Users/workhorse/tensorflow-gpu/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/Users/workhorse/tensorflow-gpu/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
ImportError: dlopen(/Users/workhorse/tensorflow-gpu/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so, 10): Library not loaded: @rpath/libcublas.8.0.dylib
Referenced from: /Users/workhorse/tensorflow-gpu/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
Reason: image not found
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/install_sources#common_installation_problems
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
我检查了常见的原因,但没有人提到我的原因。感谢您的时间和帮助!
解决方案
推荐阅读
- python - 单击时嵌套菜单选项不响应
- asp.net-mvc - 在 Razor 视图中显示 RadioButtonList 模型数据
- windows - 错误 - 无法将参数绑定到参数“InputObject”,因为它为空
- c++ - 在返回的 lambda 中为捕获的局部变量复制省略
- python-3.x - 在破折号中动态创建基于其他列值的依赖列
- c# - C#:调用线程无法访问此对象,因为不同的线程拥有它
- python - 用 Python 抓取维基百科中的表格
- python - 如何将 C++ 函数的输出保存到 python 变量
- c - 为什么我得到的是问号而不是 HTML 内容?
- angular - 使用自定义组件更改 formControl 的值