gpt4 book ai didi

python - tensorflow-gpu 1.8.0 ImportError : libcudnn. so.7:无法打开共享对象文件:没有这样的文件或目录

转载 作者:行者123 更新时间:2023-11-30 22:15:09 24 4
gpt4 key购买 nike

我刚刚安装

Ubuntu 18.04

NVIDIA GPU 驱动程序 390

CUDA工具包版本9.0(包含所有补丁)

CUDNN 7.0.5

点击了此链接 https://github.com/markjay4k/Install-Tensorflow-on-Ubuntu-17.10-/blob/master/Tensorflow%20Install%20instructions.ipynb

并代替conda进行tensorflow安装我使用过 Virtualenv

安装后,我无法在python中导入tensorflow模块由于这个错误

Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34) 
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/kai/tensorflow/local/lib/python2.7/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "/home/kai/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "/home/kai/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/home/kai/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/kai/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/kai/tensorflow/local/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: libcudnn.so.7: cannot open shared object file: No such file or directory

但我认为我正确地将它们放在正确的位置,如下所示

$ cd /usr/local/cuda/lib64
:/usr/local/cuda/lib64$ ls -l libcudnn*
-rwxr-xr-x 1 root root 287624224 May 15 19:01 libcudnn.so
-rwxr-xr-x 1 root root 287624224 May 15 19:01 libcudnn.so.7
-rwxr-xr-x 1 root root 287624224 May 15 19:01 libcudnn.so.7.0.5
-rw-r--r-- 1 root root 280805558 May 15 19:02 libcudnn_static.a

所以现在我想知道为什么会发生这种情况

感谢阅读本文

最佳答案

解决方法

sudo apt install nvidia-cuda-toolkit

不知道为什么官方网站上没有这方面的提示

关于python - tensorflow-gpu 1.8.0 ImportError : libcudnn. so.7:无法打开共享对象文件:没有这样的文件或目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50361361/

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