We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 946aef6 commit b35c472Copy full SHA for b35c472
pytorch_lightning/trainer/training_loop.py
@@ -296,6 +296,7 @@ def train(self):
296
self.current_epoch = epoch
297
298
total_val_batches = 0
299
+ is_val_epoch = False
300
if not self.disable_validation:
301
# val can be checked multiple times in epoch
302
is_val_epoch = (self.current_epoch + 1) % self.check_val_every_n_epoch == 0
@@ -346,7 +347,7 @@ def train(self):
346
347
348
# early stopping
349
met_min_epochs = epoch >= self.min_epochs - 1
- if (self.enable_early_stop and not self.disable_validation and
350
+ if (self.enable_early_stop and not self.disable_validation and is_val_epoch and
351
(met_min_epochs or self.fast_dev_run)):
352
should_stop = self.early_stop_callback.on_epoch_end(epoch=epoch,
353
logs=self.callback_metrics)
0 commit comments