【发布时间】:2017-08-27 00:33:30
【问题描述】:
我正在尝试在我的系统上使用 tensorflow-gpu。我已经重新安装了很多次,它给出了下面的错误。但是当我使用 tensorflow-cpu 时它工作正常。我安装了 cuda 8.0 工具包和 cudnn 5.1。
Traceback (most recent call last):
File "finetune.py", line 17, in <module>
import tensorflow as tf
File "/home/saurabh/code/env/local/lib/python2.7/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/home/saurabh/code/env/local/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 72, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/home/saurabh/code/env/local/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 61, in <module>
from tensorflow.python import pywrap_tensorflow
File "/home/saurabh/code/env/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "/home/saurabh/code/env/local/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.8.0: cannot open shared object file: No such file or directory
Failed to load the native TensorFlow runtime.
See https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/get_started/os_setup.md#import_error
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
【问题讨论】:
-
运行
echo $CUDA_HOME会得到什么? -
你在安装 cuda 后更新了你的 PATH 和 LD_LIBRARY_PATH 吗?
-
@Ali - 没有该名称的变量。
-
@Kochoba - 是的,我已经更新了它们。 LD_LIBRARY_PATH - /home/saurabh/cuda/lib64 和 PATH - /usr/local/cuda-8.0/bin:/home/saurabh/code/env/bin:/bin:/usr /local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin跨度>
-
运行
export CUDA_HOME=/usr/local/cuda-8.0然后重试,现在解决了吗?
标签: tensorflow keras