gpt4 book ai didi

tensorflow - AttributeError : module 'tensorflow_core._api.v2.config' has no attribute 'list_physical_devices'

转载 作者:行者123 更新时间:2023-12-03 16:06:39 53 4
gpt4 key购买 nike

我在Ubuntu 18.04上使用Tensorflow 2.0。运行时

tf.config.list_physical_devices('GPU')

我收到上述错误。解决方法是什么?

最佳答案

运行tf.config.experimental.list_physical_devices('GPU')查看所有GPU

或者

运行tf.config.experimental.list_physical_devices(device_type=None)查看所有设备

您也可以使用tf.test.is_gpu_available()。如果检测到可用的GPU,则说True。

关于tensorflow - AttributeError : module 'tensorflow_core._api.v2.config' has no attribute 'list_physical_devices' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59266150/

53 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com