Ubuntu Cuda、CuDNN已安装,但Tensorflow可以';不要使用GPU

Ubuntu Cuda、CuDNN已安装,但Tensorflow可以';不要使用GPU,ubuntu,tensorflow,gpu,cudnn,Ubuntu,Tensorflow,Gpu,Cudnn,我的系统是EC2上的Ubuntu 14.04: nvidia-smi Sun Oct 2 13:35:28 2016 +------------------------------------------------------+ | NVIDIA-SMI 352.63 Driver Version: 352.63 | |----------------------

我的系统是EC2上的Ubuntu 14.04:

nvidia-smi
Sun Oct  2 13:35:28 2016       
+------------------------------------------------------+                       
| NVIDIA-SMI 352.63     Driver Version: 352.63         |                       
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GRID K520           Off  | 0000:00:03.0     Off |                  N/A |
| N/A   37C    P0    35W / 125W |     11MiB /  4095MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID  Type  Process name                               Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+
ubuntu@ip-XXX-XX-XX-990:~$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2015 NVIDIA Corporation
Built on Tue_Aug_11_14:27:32_CDT_2015
Cuda compilation tools, release 7.5, V7.5.17
我安装了CUDA 7.5和CuDNN 5.1

我在/usr/local/local/lib64和include文件夹中有适当的文件

Tensorflow线没有给出任何信息:

    sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))

>>> sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
Device mapping: no known devices.
I tensorflow/core/common_runtime/direct_session.cc:252] Device mapping:

>>> 

请帮助(非常感谢:)。

您是如何构建tensorflow的

如果您使用bazel,那么您是否正确添加了--config=cuda

如果你用pip安装了它,你是否正确地使用了gpu启用的那一个

编辑:

您可以在此处看到如何使用pip进行安装:

您需要使用与gpu兼容的二进制文件:

# Ubuntu/Linux 64-bit, GPU enabled, Python 2.7
# Requires CUDA toolkit 7.5 and CuDNN v5. For other versions, see "Install from sources" below.
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.11.0rc0-cp27-none-linux_x86_64.whl

# Mac OS X, GPU enabled, Python 2.7:
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/gpu/tensorflow-0.11.0rc0-py2-none-any.whl

# Ubuntu/Linux 64-bit, GPU enabled, Python 3.4
# Requires CUDA toolkit 7.5 and CuDNN v5. For other versions, see "Install from sources" below.
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.11.0rc0-cp34-cp34m-linux_x86_64.whl

# Ubuntu/Linux 64-bit, GPU enabled, Python 3.5
# Requires CUDA toolkit 7.5 and CuDNN v5. For other versions, see "Install from sources" below.
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.11.0rc0-cp35-cp35m-linux_x86_64.whl

# Mac OS X, GPU enabled, Python 3.4 or 3.5:
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/gpu/tensorflow-0.11.0rc0-py3-none-any.whl
然后安装tensorflow:

# Python 2
$ sudo pip install --upgrade $TF_BINARY_URL

# Python 3
$ sudo pip3 install --upgrade $TF_BINARY_URL

你是如何建立tensorflow的

如果您使用bazel,那么您是否正确添加了--config=cuda

如果你用pip安装了它,你是否正确地使用了gpu启用的那一个

编辑:

您可以在此处看到如何使用pip进行安装:

您需要使用与gpu兼容的二进制文件:

# Ubuntu/Linux 64-bit, GPU enabled, Python 2.7
# Requires CUDA toolkit 7.5 and CuDNN v5. For other versions, see "Install from sources" below.
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.11.0rc0-cp27-none-linux_x86_64.whl

# Mac OS X, GPU enabled, Python 2.7:
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/gpu/tensorflow-0.11.0rc0-py2-none-any.whl

# Ubuntu/Linux 64-bit, GPU enabled, Python 3.4
# Requires CUDA toolkit 7.5 and CuDNN v5. For other versions, see "Install from sources" below.
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.11.0rc0-cp34-cp34m-linux_x86_64.whl

# Ubuntu/Linux 64-bit, GPU enabled, Python 3.5
# Requires CUDA toolkit 7.5 and CuDNN v5. For other versions, see "Install from sources" below.
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.11.0rc0-cp35-cp35m-linux_x86_64.whl

# Mac OS X, GPU enabled, Python 3.4 or 3.5:
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/gpu/tensorflow-0.11.0rc0-py3-none-any.whl
然后安装tensorflow:

# Python 2
$ sudo pip install --upgrade $TF_BINARY_URL

# Python 3
$ sudo pip3 install --upgrade $TF_BINARY_URL

@talonmies现有的解决方案不起作用,我已经一次又一次地检查了路径变量。您的CUDA安装似乎正在运行。因此,这是一个tensorflow配置问题,与CUDA编程无关。这就是我恢复标记的原因。@Talonmes是的,我就是这么想的,链接或路径中一定有问题……就像这样。你能给我一些建议吗?谢谢,我也有同样的问题。我建议您从@talonmies检查Tensorflow与CUDA/cuDNN/Python的兼容性现有解决方案不起作用,我已反复检查路径变量。您的CUDA安装似乎正常。因此,这是一个tensorflow配置问题,与CUDA编程无关。这就是我恢复标记的原因。@Talonmes是的,我就是这么想的,链接或路径中一定有问题……就像这样。你能给我一些建议吗?谢谢,我也有同样的问题。我建议您检查Tensorflow与CUDA/cuDNN/Python的兼容性,gpu的pip选项是什么?我在pip附近没有看到任何gpu命令。请让我知道,如果有任何命令,我会标记为答案。谢谢。我编辑了我的答案,你可以检查一下。我希望有帮助。没有实物期权只需要使用正确的二进制。gpu的pip选项是什么?我在pip附近没有看到任何gpu命令。请让我知道,如果有任何命令,我会标记为答案。谢谢。我编辑了我的答案,你可以检查一下。我希望有帮助。没有实物期权,只需要选择正确的二进制。