首页 > 解决方案 > 如何在 TensorFlow 2.n 中启用设备放置日志记录 (log_device_placement)

问题描述

我想看看哪些操作在哪个设备上运行。在 TensorFlow 1.n 中,可以使用会话配置 (log_device_placement)。TF 2.n 中是否有类似的操作?

标签: tensorflow2.0tensorflow2.x

解决方案


为了查找哪些操作在哪个设备上运行,请使用

tf.debugging.set_log_device_placement(True) 

作为导入 TensorFlow 后的第一行。您可以在此处找到更多详细信息


推荐阅读