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


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

应该是接口更新了,改成以下接口就不会报错了。

查看所有GPU

tf.config.experimental.list_physical_devices('GPU')

查看所有设备

tf.config.experimental.list_physical_devices(device_type=None)


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM