def on_epoch_begin(self, epoch, logs=None):
    if (not hasattr(self.model.optimizer, 'learning_rate')):
        raise ValueError('Optimizer must have a "learning_rate" attribute.')
    self.epochs += 1
def on_epoch_begin(self, epoch, logs=None):
    if (not hasattr(self.model.optimizer, 'learning_rate')):
        raise ValueError('Optimizer must have a "learning_rate" attribute.')
    self.epochs += 1