AttributeError: module 'tensorflow._api.v1.keras.metrics' has no attribute 'Mean'


問題描述:

使用tf 1.14.0 如下模塊報錯:

train_loss = tf.keras.metrics.Mean('train_loss', dtype=tf.float32)

AttributeError: module 'tensorflow._api.v1.keras.metrics' has no attribute 'Mean'

問題解決:

更新tf即可:

pip install -U tensorflow


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM