My model stops training after the 4th epoch even though I expect it to continue training beyond that. I've set monitor to validation loss and patience to 2, which I thought means that training stops after validation loss increases consecutively for 2 epochs. However, training seems to stop before that happens.
I've defined EarlyStopping as follows:
callbacks = [
EarlyStopping(monitor='val_loss', patience=2, verbose=0),
]
And in the fit function I use it like this:
hist = model.fit_generator(
generator(imgIds, batch_size=batch_size, is_train=True),
validation_data=generator(imgIds, batch_size=batch_size, is_val=True),
validation_steps=steps_per_val,
steps_per_epoch=steps_per_epoch,
epochs=epoch_count,
verbose=verbose_level,
callbacks=callbacks)
I don't understand why training ends after the 4th epoch.
675/675 [==============================] - 1149s - loss: 0.1513 - val_loss: 0.0860
Epoch 2/30
675/675 [==============================] - 1138s - loss: 0.0991 - val_loss: 0.1096
Epoch 3/30
675/675 [==============================] - 1143s - loss: 0.1096 - val_loss: 0.1040
Epoch 4/30
675/675 [==============================] - 1139s - loss: 0.1072 - val_loss: 0.1019
Finished training intermediate1.