Here’s my runner code snippet:
from pytorch_lightning.callbacks import ModelCheckpoint
checkpoint_callback = ModelCheckpoint(
save_top_k=5,
verbose=True,
monitor='avg_val_loss',
mode='min'
)
from pytorch_lightning.callbacks.early_stopping import EarlyStopping
early_stop_callback = EarlyStopping(
monitor='avg_val_accuracy',
min_delta=0.00,
patience=10,
verbose=True,
mode='max'
)
model = Model()
trainer = Trainer(gpus=1,
callbacks=[early_stop_callback],
checkpoint_callback=checkpoint_callback)
trainer.fit(model)
My above training stops with the output:
Epoch 29: avg_val_loss was not in top 5
Does this mean the ModelCheckpoint
callback also performs some kind of early stopping?
If not, why is my EarlyStopping
callback not being effective?