gpt4 book ai didi

tensorflow - ImportError : libcublas. so.9.0 : cannot open shared object file: No such file or directory even if libcublas. so.9.0 存在于路径中

转载 作者:行者123 更新时间:2023-12-04 02:24:47 25 4
gpt4 key购买 nike

我的机器信息:

  • nvcc --version:

    nvcc:NVIDIA (R) Cuda 编译器驱动程序
    版权所有 (c) 2005-2017 NVIDIA 公司
    建立于 Fri_Sep__1_21:08:03_CDT_2017
    Cuda编译工具,版本9.0,V9.0.176

  • cuda驱动版本

    • 版本 - 9.2
    • 文件 - nvidia-diag-driver-local-repo-rhel7-396.26-1.0-1.x86_64.rpm
  • cat/etc/redhat-release: CentOS Linux 发行版 7.5.1804(核心版)

cat .bashrc 包括以下内容

PATH=$PATH:/usr/local/cuda/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64
CUDA_HOME=$CUDA_HOME:/usr/local/cuda

在此之后如果我尝试导入 torch 或 torchvision,它工作正常。但是我导入了tensorflow,它没有导入

我的 tensorflow 版本如下:

  • 张量板==1.8.0
  • tensorflow-gpu==1.8.0

我收到以下错误:

>>> import tensorflow
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/usr/local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/usr/local/lib/python3.6/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/local/lib/python3.6/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/usr/local/lib/python3.6/imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: libcublas.so.9.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/local/lib/python3.6/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "/usr/local/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "/usr/local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/usr/local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/usr/local/lib/python3.6/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/local/lib/python3.6/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/usr/local/lib/python3.6/imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: libcublas.so.9.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.

但是 /usr/local/cuda/lib64 有以下内容:

  • libcublas_device.a
  • libcublas.so
  • libcublas.so.9.0
  • libcublas.so.9.0.176
  • libcublas_static.a

我无法找出问题所在。许可与此有关吗?后来我将上述文件的所有者和权限更改为 current 和 755。仍然出现相同的错误。

最佳答案

只需将提到的路径添加到您的 LD_LIBRARY_PATH 中:

 export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH

关于tensorflow - ImportError : libcublas. so.9.0 : cannot open shared object file: No such file or directory even if libcublas. so.9.0 存在于路径中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51247972/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com