tensorflow 如何使用多个GPU运行深度排序?

eqoofvh9  于 2023-05-01  发布在  其他
关注(0)|答案(1)|浏览(105)

我正在跟踪this tutorial。我有两个nvidia 1080钛图形卡,但我不能代码。

我在第8行有错误,我也有一台笔记本电脑与一个GPU,这段代码工作正常
我把密码改了一点。

tf.config.experimental.set_memory_growth(physical_devices[0:1], True)

但还是同样的错误

du7egjpx

du7egjpx1#

感谢社区,我找到了答案。
而不是使用:

tf.config.experimental.set_memory_growth(physical_devices[0:1], True)

我必须使用:

tf.config.experimental.set_memory_growth(physical_devices[0], True)
tf.config.experimental.set_memory_growth(physical_devices[1], True)

有了这个修改,我的代码在我的GPU上运行得很好,没有提出任何错误。

相关问题