首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >找不到为什么Tensorflow-GPU不使用我的GPU,以及为什么它显示N instaed of Y作为输出

找不到为什么Tensorflow-GPU不使用我的GPU,以及为什么它显示N instaed of Y作为输出
EN

Stack Overflow用户
提问于 2018-05-26 23:48:37
回答 1查看 1.1K关注 0票数 0

代码语言:javascript
复制
(tfenv) hobbes@hobbes-HP-Pavilion-Notebook:~/tfenv$ python
Python 3.6.5 (default, Apr  1 2018, 05:46:30) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
/home/hobbes/tfenv/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
>>> with tf.device('/gpu:0'):
...     a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')
...     b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')
...     c = tf.matmul(a, b)
... 
>>> with tf.Session() as sess:
...     print (sess.run(c))
... 
2018-05-26 17:39:53.860779: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2018-05-26 17:39:53.946021: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:898] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2018-05-26 17:39:53.946434: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1356] Found device 0 with properties: 
name: GeForce GTX 960M major: 5 minor: 0 memoryClockRate(GHz): 1.176
pciBusID: 0000:01:00.0
totalMemory: 1.96GiB freeMemory: 1.66GiB
2018-05-26 17:39:53.946450: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1435] Adding visible gpu devices: 0
2018-05-26 17:39:54.449040: I tensorflow/core/common_runtime/gpu/gpu_device.cc:923] Device interconnect StreamExecutor with strength 1 edge matrix:
2018-05-26 17:39:54.449064: I tensorflow/core/common_runtime/gpu/gpu_device.cc:929]      0 
2018-05-26 17:39:54.449070: I tensorflow/core/common_runtime/gpu/gpu_device.cc:942] 0:   N 
2018-05-26 17:39:54.449194: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1053] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 1416 MB memory) -> physical GPU (device: 0, name: GeForce GTX 960M, pci bus id: 0000:01:00.0, compute capability: 5.0)
[[22. 28.]
 [49. 64.]]

是的,我已经这样做了几个星期,我真的很疲惫,因此我决定寻求某人的帮助,任何人,愿意向我解释为什么我的输出返回: 2018-05-26 17:39:54.449070: I tensorflow/core/common_runtime/gpu/gpu_device.cc:942] 0: N,而不是Y。

任何形式的帮助都将非常感谢,真的。

以下是我在Ubuntu 18.04上的终端中输入nvidia-smi时的输出

代码语言:javascript
复制
<pre><font color="#8AE234"><b>hobbes@hobbes-HP-Pavilion-Notebook</b></font>:<font color="#729FCF"><b>~</b></font>$ nvidia-smi
Sat May 26 18:23:59 2018       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 396.24                 Driver Version: 396.24                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 960M    Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   55C    P8    N/A /  N/A |    267MiB /  2002MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1286      G   /usr/lib/xorg/Xorg                            24MiB |
|    0      1464      G   /usr/bin/gnome-shell                          48MiB |
|    0      1650      G   /usr/lib/xorg/Xorg                           103MiB |
|    0      1820      G   /usr/bin/gnome-shell                          87MiB |
+-----------------------------------------------------------------------------+
<font color="#8AE234"><b>hobbes@hobbes-HP-Pavilion-Notebook</b></font>:<font color="#729FCF"><b>~</b></font>$ 

</pre>

EN

回答 1

Stack Overflow用户

发布于 2018-05-27 00:13:16

对不起,你可能确实安装了tensorflow-gpu,但你得问问你是否真的安装了。如果您通过适当的版本正确地管理了cuDNN库。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50544493

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档