<< 当我运行下面的代码时,我已经导入了 import tensorflow_addons as tfa
densenetmodelupdated.compile(loss ='categorical_crossentropy', optimizer=sgd_optimizer, metrics=
['accuracy', tf.keras.metrics.Recall(),
tf.keras.metrics.Precision(),
tf.keras.metrics.AUC(),
tfa.metrics.F1Score(num_classes=25, average="macro")])
Run Code Online (Sandbox Code Playgroud)
<<显示错误
AttributeError Traceback (most recent call last)
<ipython-input-25-5f3ab8b4cc77> in <module>()
16 tf.keras.metrics.Precision(),
17 tf.keras.metrics.AUC(),
---> 18 tfa.metrics.F1Score(num_classes=25, average="macro")])
AttributeError: module 'tensorflow.keras.metrics' has no attribute 'F1Score'
Run Code Online (Sandbox Code Playgroud)