gpt4 book ai didi

python-3.x - ImportError : libcublas. so.9.0:无法打开共享对象文件

转载 作者:行者123 更新时间:2023-12-03 07:50:06 27 4
gpt4 key购买 nike

目前我在 Gpu 支持系统中安装了 cuda 8.0 和 cuda 9.0。我在从 keras 模块导入时遇到了这个错误。它说无法加载 native tensorflow 运行时。我收到的错误日志是:

Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/usr/local/lib/python3.5/dist-
packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/usr/local/lib/python3.5/dist-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/lib/python3.5/imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "/usr/lib/python3.5/imp.py", line 342, 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 "Try1.py", line 11, in <module>
from keras.models import Sequential
File "/usr/local/lib/python3.5/dist-packages/Keras-2.0.9-py3.5.egg/keras/__init__.py", line 3, in <module>
File "/usr/local/lib/python3.5/dist-packages/Keras-2.0.9-py3.5.egg/keras/utils/__init__.py", line 6, in <module>
File "/usr/local/lib/python3.5/dist-packages/Keras-2.0.9-py3.5.egg/keras/utils/conv_utils.py", line 3, in <module>
File "/usr/local/lib/python3.5/dist-packages/Keras-2.0.9-py3.5.egg/keras/backend/__init__.py", line 83, in <module>
File "/usr/local/lib/python3.5/dist-packages/Keras-2.0.9-py3.5.egg/keras/backend/tensorflow_backend.py", line 1, in <module>
File "/usr/local/lib/python3.5/dist-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 73, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/usr/local/lib/python3.5/dist-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/lib/python3.5/imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "/usr/lib/python3.5/imp.py", line 342, 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.

当我运行 nvcc --version 时,返回的 cuda 版本是,
Cuda compilation tools, release 8.0, V8.0.61

我阅读了一些类似的帖子,但无法解决我的问题。大多数情况下,我认为这是两个 cuda 版本之间的冲突。谁能告诉我如何解决这个问题?提前致谢。

最佳答案

发生这种情况是因为系统正在寻找合适的 cuda 版本来运行训练。我在 conda 中以一种简单的方式解决了这个问题。
前往 link并为您的 tensorflow 找到 cuda 版本。
找到后,执行此操作。
通过以下方式搜索特定的 cudatoolkit 版本conda search cudatoolkitconda install cudatoolkit=*give_your_version_number_here*接下来安装对应的cudnn搜索 conda search cudnn ,这将显示相​​应的cudnn为您的cudatoolkit你刚刚安装。
最后只是安装,conda install cudnn=*your_version_number*P.S -> 这就是 conda 的美妙之处。不要弄脏你的手,当你没有havta时;)

关于python-3.x - ImportError : libcublas. so.9.0:无法打开共享对象文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48428415/

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