tensorflow - Tensorflow 未检测到 GPU - 添加可见 gpu 设备:0
问题描述
我有一个带有 NVIDIA GeForce GTX 980 Ti 的系统。我安装了 tensorflow,并使用 tf.test.gpu_device_name() 查找 gpu 设备。看起来它找到了 gpu,但随后显示“添加可见 gpu 设备:0”
>>> import tensorflow as tf
>>> tf.test.gpu_device_name()
2019-01-08 10:01:12.589000: I tensorflow/core/platform/cpu_feature_guard.cc:141]
Your CPU supports instructions that this TensorFlow binary was not compiled to
use: AVX2
2019-01-08 10:01:12.855000: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1
432] Found device 0 with properties:
name: GeForce GTX 980 Ti major: 5 minor: 2 memoryClockRate(GHz): 1.228
pciBusID: 0000:01:00.0
totalMemory: 6.00GiB freeMemory: 5.67GiB
2019-01-08 10:01:12.862000: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1
511] Adding visible gpu devices: 0
解决方案
有趣的是,你关心的 0 并不是你用来计数的 0。准确地说,它不是“检测到 0 个设备”而是“检测到设备 0”。“添加可见设备 0”,这里的 0 是您 GPU 的标识。或者你可以说,tensorflow 的方式来区分系统中的多个 GPU。这是我的系统的输出,我很确定,我正在用 gpu 进行计算。所以不用担心。你已准备好出发!
Python 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 03:37:03) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> tf.test.gpu_device_name()
2019-01-08 20:51:02.212125: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2019-01-08 20:51:03.199893: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1411] Found device 0 with properties:
name: GeForce GTX 1060 with Max-Q Design major: 6 minor: 1 memoryClockRate(GHz): 1.3415
pciBusID: 0000:01:00.0
totalMemory: 6.00GiB freeMemory: 4.97GiB
2019-01-08 20:51:03.207308: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1490] Adding visible gpu devices: 0
2019-01-08 20:51:04.857881: I tensorflow/core/common_runtime/gpu/gpu_device.cc:971] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-01-08 20:51:04.861791: I tensorflow/core/common_runtime/gpu/gpu_device.cc:977] 0
2019-01-08 20:51:04.863796: I tensorflow/core/common_runtime/gpu/gpu_device.cc:990] 0: N
2019-01-08 20:51:04.867507: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1103] Created TensorFlow device (/device:GPU:0 with 4722 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1060 with Max-Q Design, pci bus id: 0000:01:00.0, compute capability: 6.1)
'/device:GPU:0'
推荐阅读
- oauth-2.0 - 在 SAML 身份验证后使用 JWT 授权 REST API 请求
- linux - Apache RewriteRule 重写子目录不起作用
- android - 导航主机片段正在覆盖前一个片段上的目标片段
- c# - 如何在 .Net Core MVC 中保存选定的值下拉列表?
- regex - 在脚本中的通配符中使用括号时,意外标记“(”附近的bash语法错误
- clickhouse - 如何在 ClickHouse 中获取 FLAG 的值
- winapi - EnumProcessModules 返回 0 错误 299
- powershell - Find-Package 没有 -ScriptSourceLocation 参数
- azure - 使用 CopyIndex() 在 Azure ARM 模板中创建输出
- java - Bukkit/Spigot。当我输入命令时,它只返回命令