python - 为什么 GPU 没有在 python 中显示
问题描述
我的笔记本电脑是戴尔 xps 15,它有 Intel 和 Nvidia GPU。当我通过 dxdiag 检查时,它只显示 Intel GPU。
当我转到设备管理器时,它会显示两个 GPU。
现在,当我键入以下代码时,Spider 控制台中什么也没有。
代码 1:
Import tensorflow as tf
tf.test.is_gpu_available()
代码 2:
Import tensorflow as tf
tf.test.gpu_device_name()
代码 3:
from tensorflow.python.client import device_lib
def get_available_gpus():
local_device_protos = device_lib.list_local_devices()
return [x.name for x in local_device_protos if x.device_type == 'GPU']
问题是什么?如何解决这个错误?我需要启用或激活某些东西吗?
解决方案
推荐阅读
- swift - SwiftUI 覆盖在 NavigationView / NavigationBarTitle 之上
- c# - MongoDB C# 驱动程序:如何忽略 Insert 上的属性,但不在 .Lookup() 中
- python - 为什么一个列表被清除时另一个列表被清除?
- postgresql - 关于 Heroku Postgres 20 个连接的限制,如果我关闭 pgadmin,我是否必须浪费另一个连接?
- php - Laravel 7.x 使用电话登录,而不是使用使用尝试登录()方法的自定义登录的电子邮件
- android - 手动更改权限时崩溃
- python - Python Pandas 中的 Excel IF 和 COUNTIF
- mysql - MySql 使用索引改进 GROUP BY ORDER BY 查询
- javascript - 处理多个
- flutter - 有没有办法在飞镖流获得第一个结果时得到通知?