Open erkandiken opened 5 years ago
The following code does not work with TF 2.0:
accuracy = logs.get('acc')
instead, the following code should be used.
accuracy = logs.get('accuracy')
Complete working example code:
def on_epoch_end(self, epoch, logs={}): acc_threshold = 0.99 accuracy = logs.get('accuracy') if accuracy > acc_threshold: print('\nReached {0} % accuracy so cancelling training!\n'.format(acc_threshold)) self.model.stop_training = True
that's right!
The following code does not work with TF 2.0:
accuracy = logs.get('acc')
instead, the following code should be used.
accuracy = logs.get('accuracy')
Complete working example code: