Open yohei1126 opened 4 years ago
class myCallback(tf.keras.callbacks.Callback): def on_epoch_end(self, epoch, logs={}): if(logs.get('accuracy')>0.6): print("\nReached 60% accuracy so cancelling training!") self.model.stop_training = True
This does not work. logs.get('accuracy') always returns None. It should be
logs.get('accuracy')
None
class myCallback(tf.keras.callbacks.Callback): def on_epoch_end(self, epoch, logs={}): if(logs.get('acc')>0.6): print("\nReached 60% accuracy so cancelling training!") self.model.stop_training = True
Yes, I had a sames result. logs.get('accuracy') made error but logs.get('acc') is ok.
This is because of Tensorflow 1. If you upgrade it to Tensorflow 2, 'accuracy' should work.
This does not work.
logs.get('accuracy')
always returnsNone
. It should be