Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

module 'tensorflow' has no attribute 'log'

fashion_model.compile(
    loss = keras.losses.categorical_crossentropy,
    optimizer = tf.keras.optimizers.Adam(),
    metrics = ['accuracy']
)

When I execute this line of code I am facing the error

module 'tensorflow' has no attribute 'log'

and my tensorflow version is 2.0

like image 817
neelima golla Avatar asked Sep 16 '25 07:09

neelima golla


1 Answers

substitute tf.math.log for tf.log in tf 2.0.

like image 52
wei liangwu Avatar answered Sep 19 '25 07:09

wei liangwu