Tensorflow 2.0列表\物理\设备未检测到我的GPU

2024-05-29 02:29:23 发布

您现在位置:Python中文网/ 问答频道 /正文

我最近在我的电脑上安装了tensorflow 2.0,但是当我尝试在GPU上运行它时,Jupyter或Vitual Studio代码上的函数tf.config.experimental.list_physical_devices('GPU')会返回一个空数组。你知道为什么吗?你知道吗

我的设置:

计算机:MSI

处理器:Intel(R)Core(TM)i7-8750H CPU@2.220GHz

GPU 0:Intel(R)UHD图形630

GPU:NVIDIA GeForce GTX 1060

Python:ananconda3和python3.7

Tensenflow 2.0与pip install tensorflow一起安装

我的测试代码:

physical_devices = tf.config.experimental.list_physical_devices('GPU')
print(physical_devices)
if physical_devices:
  tf.config.experimental.set_memory_growth(physical_devices[0], True)

提前谢谢!:)


Tags: 函数代码configgputftensorflowjupyterlist

热门问题