gpt4 book ai didi

python - TensorFlow:libcudart.so.7.5:无法打开共享对象文件:没有这样的文件或目录

转载 作者:IT老高 更新时间:2023-10-28 21:13:08 24 4
gpt4 key购买 nike

我在 Ubuntu 15.10 上运行 TensorFlow。当我输入pip show tensorflow时,我看到TF已经正确安装了。

但是,当我编写 import tensorflow as tf 时,我收到以下错误消息:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/me/anaconda2/lib/python2.7/site-packages/tensorflow/__init__.py", line 23, in <module>
from tensorflow.python import *
File "/home/me/anaconda2/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 49, in <module>
from tensorflow import contrib
File "/home/me/anaconda2/lib/python2.7/site-packages/tensorflow/contrib/__init__.py", line 23, in <module>
from tensorflow.contrib import layers
File "/home/me/anaconda2/lib/python2.7/site-packages/tensorflow/contrib/layers/__init__.py", line 68, in <module>
from tensorflow.contrib.layers.python.layers import *
File "/home/me/anaconda2/lib/python2.7/site-packages/tensorflow/contrib/layers/python/layers/__init__.py", line 22, in <module>
from tensorflow.contrib.layers.python.layers.initializers import *
File "/home/me/anaconda2/lib/python2.7/site-packages/tensorflow/contrib/layers/python/layers/initializers.py", line 24, in <module>
from tensorflow.python.ops import random_ops
File "/home/me/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/random_ops.py", line 23, in <module>
from tensorflow.python.framework import ops
File "/home/me/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 39, in <module>
from tensorflow.python.framework import versions
File "/home/me/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/versions.py", line 22, in <module>
from tensorflow.python import pywrap_tensorflow
File "/home/me/anaconda2/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "/home/me/anaconda2/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
ImportError: libcudart.so.7.5: cannot open shared object file: No such file or directory

对于它的值(value),我已按照说明 here并设置我的 LD_LIBRARY_PATHCUDA_HOME 环境变量。

有什么建议吗?

编辑:

我已经安装了 CUDA 7.5 并将这些添加到我的 .profile 文件中:

export LD_LIBRARY_PATH="/usr/local/cuda-7.5/lib64"
export CUDA_HOME=/usr/local/cuda-7.5

但是,我仍然看到相同的错误消息。

编辑:

我在运行 ldd/usr/local/cuda-7.5/lib64/libcudart.so.7.5 时看到以下输出:

linux-vdso.so.1 =>  (0x00007ffdac7ea000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc27a281000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fc27a07d000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fc279e5e000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fc279c56000)
/lib64/ld-linux-x86-64.so.2 (0x00005604f5406000)

编辑:

如果相关,我使用 GeForce GT640。

编辑:

我关注了@tommus' advice并在运行 TensorFlow 之前调用了 source ~/.profile,现在它就像一个魅力。

感谢所有试图在评论中帮助我的人——这是我第一次使用任何类型的 Linux 发行版,我真的非常感谢我收到的所有耐心帮助远 :-) 你们真是太棒了!

最佳答案

编辑 .profile 文件后,您要么需要注销并重新登录,要么运行以下命令:

来源 ~/.profile

解决方案是持久的,因此无需再次执行。

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

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