python - "ImportError: libcublas.so.10.0"仅在使用 GUI 时用于 Tensorflow

标签 python linux tensorflow centos

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

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

  • python 3.4.9
  • Tensorflow-GPU 1.13.1
  • 库达 10.0
  • Nvidia 驱动程序 481.56

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

当我启动 GUI 并尝试在 GUI 终端上导入 tensorflow 时,出现典型的导入错误:

>>>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 打开时是否有任何防火墙或任何限制?谢谢!

关于python - "ImportError: libcublas.so.10.0"仅在使用 GUI 时用于 Tensorflow,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55740298/

相关文章:

python - SQLAlchemy 在事务中空闲

python - Sklearn 模型系数并预测 linear_model 中的不匹配

python - 在 TensorFlow 中保存和恢复函数

python - matplotlib 将 x 轴上的刻度线命名为 1、2、4、8、16 等

python - 在 Python 中将表/数据框与公共(public)列连接起来

linux - 为 tcpdump 编写一个 linux 脚本以停止并再次运行,但将信息保存在另一个文件中

python - Udacity 深度学习卷积神经网络 - TensorFlow

python - 我无法运行我的代码Tensorflow

c++ - 如何在 Ubuntu 14.04 上的交叉编译器 g++-arm-linux-gnueabifh 中安装 libbz2

python - 需要为 Python 2.7 重新安装 urllib2