简体   繁体   中英

TensorFlow: AttributeError: 'Tensor' object has no attribute 'log10'

I have been using tensorflow with python3 support. There is line in my code which throws me an error.

The error here :

return -10. * np.log10(K.mean(K.square(y_pred - y_true)))

AttributeError: 'Tensor' object has no attribute 'log10'

您可以这样:

return 10.0 * K.log(1.0 / (K.mean(K.square(y_pred - y_true)))) / K.log(10.0)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM