Python 在ubuntu上安装tensorf flow的问题
我在Linux上安装了tensorflow,但是当我尝试在python shell中导入它时,它找不到模块。我在tensorflow网站上找不到错误信息。有人对我如何修复它有什么想法吗 每当我发出命令时:Python 在ubuntu上安装tensorf flow的问题,python,tensorflow,cuda,Python,Tensorflow,Cuda,我在Linux上安装了tensorflow,但是当我尝试在python shell中导入它时,它找不到模块。我在tensorflow网站上找不到错误信息。有人对我如何修复它有什么想法吗 每当我发出命令时: import tensorflow as tf 我得到的回报是: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/beheerder/a
import tensorflow as tf
我得到的回报是:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/beheerder/anaconda2/lib/python2.7/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/home/beheerder/anaconda2/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 51, in <module>
from tensorflow.python import pywrap_tensorflow
File "/home/beheerder/anaconda2/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 52, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/home/beheerder/anaconda2/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/beheerder/anaconda2/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/beheerder/anaconda2/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: libcublas.so.8.0: cannot open shared object file: No such file or directory
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.
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
文件“/home/beheerder/anaconda2/lib/python2.7/site packages/tensorflow/_init__.py”,第24行,在
从tensorflow.python导入*
文件“/home/beheerder/anaconda2/lib/python2.7/site packages/tensorflow/python/_init__.py”,第51行,在
从tensorflow.python导入pywrap\u tensorflow
文件“/home/beheerder/anaconda2/lib/python2.7/site packages/tensorflow/python/pywrap\u tensorflow.py”,第52行,在
提高效率(msg)
ImportError:回溯(最近一次呼叫上次):
文件“/home/beheerder/anaconda2/lib/python2.7/site packages/tensorflow/python/pywrap_tensorflow.py”,第41行,在
从tensorflow.python.pywrap\u tensorflow\u内部导入*
文件“/home/beheerder/anaconda2/lib/python2.7/site packages/tensorflow/python/pywrap\u tensorflow\u internal.py”,第28行,在
_pywrap\u tensorflow\u internal=swig\u import\u helper()
swig\u import\u helper中的文件“/home/beheerder/anaconda2/lib/python2.7/site packages/tensorflow/python/pywrap\u tensorflow\u internal.py”,第24行
_mod=imp.load_模块(“pywrap_tensorflow_internal”,fp,路径名,描述)
ImportError:libcublas.so.8.0:无法打开共享对象文件:没有此类文件或目录
未能加载本机TensorFlow运行时。
看见https://www.tensorflow.org/install/install_sources#common_installation_problems
因为一些常见的原因和解决方案。包括整个堆栈跟踪
以上是请求帮助时的错误消息。
它似乎找不到您的Cuda库。您要检查的内容包括:
- 你真的有GPU吗?如果不是:重新安装非GPU tensorflow
- 你们有Cuda 8.0版吗?在您可以使用旧版本之前,但自从Tensorflow 1.0发布以来,您必须至少拥有版本8。可能需要重新安装Cuda来解决此问题
祝你好运 仔细检查你的错误就好像你在用巨蟒做你的张量流。我有这个错误,似乎tensorflow的anacoda gpu仍在开发中,不能正常工作 我建议您在anaconda环境之外安装tensorflow gpu版本。不过,cpu版本工作正常 清洁后,再次安装它,而不使用python 2.7的anacoda。做:
cd /opt/DL/tensorflow/bin/
source tensorflow-activate
请说明该设备是否为gpu/cpu,以及您安装tensorflow的方式。