【发布时间】:2019-11-20 14:25:49
【问题描述】:
我最近在我的计算机上安装了 tensorflow 2.0,但是当我尝试在我的 GPU 上运行它时,Jupyter 或 Vitual Studio Code 上的函数 tf.config.experimental.list_physical_devices('GPU') 它返回给我一个空数组。你知道为什么吗?
我的设置:
计算机:微星
处理器:Intel(R) Core(TM) i7-8750H CPU @ 2.220GHz
GPU 0:英特尔(R) 超高清显卡 630
GPU:NVIDIA GeForce GTX 1060
Python : Ananconda 3 和 Python 3.7
使用pip install tensorflow安装的Tensenflow 2.0
我的测试代码:
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)
提前致谢! :)
【问题讨论】:
-
您是尝试“pip3 install --upgrade tensorflow-gpu”还是删除 tensorflow 然后安装“tensorflow-gpu”?
标签: python gpu tensorflow2.0