仅在使用 GUI 时对 Tensorflow 进行"ImportError: libcublas.so.10.0"



我有 Centos7 的最小安装,也安装了 GNOME 桌面。我主要远程使用终端,但在使用相机时使用GUI。

以下是我使用的程序/包:

  • 蟒蛇 3.4.9
  • Tensorflow-gpu 1.13.1
  • 库达 10.0
  • 英伟达驱动程序 481.56

当我使用终端并导入张量流时,一切都按预期运行。

当我启动 GUI 并尝试在 GUI 终端上导入张量流时,我收到典型的导入错误:

>>>import tensorflow as tf
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/usr/lib/python3.4/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/usr/lib/python3.4/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "/usr/lib64/python3.4/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.4/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
File "/usr/lib/python3.4/site-packages/tensorflow/python/__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "/usr/lib/python3.4/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/usr/lib/python3.4/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/usr/lib/python3.4/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "/usr/lib64/python3.4/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory

Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.

同样,当我在没有GUI的情况下在终端上运行它时,我没有收到此错误。即使我打开 GUI 并收到此导入错误,我也会通过 SSH 连接到我的机器,我仍然可以在 SSH 窗口导入 tensorflow。

我的路径应该没问题,因为同样,它成功导入,只是在 GUI 上导入时没有。这是一个非常奇怪的问题,我完全不知道为什么会发生这种情况。

我还尝试了各种兼容的 tensorflow 和 Cuda 以及其他桌面版本。我仍然遇到这个问题。

我想补充一点,我最近重新安装了所有内容,只是将我的/home 目录复制到新安装中。所以在此之前,无论有没有GUI,一切正常。

这很奇怪。该错误说它找不到 CUDA10 文件 (libcublas.so.10.0) 的路径。但是,如果您在SSH窗口上导入TF,则不会抱怨。使用 GUI 打开时是否有任何防火墙或任何限制?谢谢!

相关内容

最新更新