我正在尝试在v2.0中运行tensorflow代码,我收到以下错误
AttributeError: module 'tensorflow' has no attribute 'logging'
我不想简单地从代码中删除它。
tf.logging用于Logging and Summary Operations
,在TF 2.0中,它已被删除,支持开源absl-py,并使主要的tf。*命名空间具有更常用的函数。
在TF.2中,较少使用的函数已经消失或移动到像tf.math这样的子包中
因此,您可以:而不是tf.logging:
tf_upgrade_v2
将升级脚本并将tf.logging
更改为tf.compat.v1.logging