From b1c713d628ddb4ab3203f8b99c11a758961be8b4 Mon Sep 17 00:00:00 2001 From: Mateusz Pieniak Date: Sun, 17 May 2020 16:33:38 +0200 Subject: [PATCH 1/2] Removing unecessary early stopping calls --- pytorch_lightning/trainer/training_loop.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pytorch_lightning/trainer/training_loop.py b/pytorch_lightning/trainer/training_loop.py index 61358731f796f..62f3809480426 100644 --- a/pytorch_lightning/trainer/training_loop.py +++ b/pytorch_lightning/trainer/training_loop.py @@ -452,7 +452,6 @@ def run_training_epoch(self): if self.fast_dev_run or should_check_val: self.run_evaluation(test_mode=self.testing) self.call_checkpoint_callback() - self.call_early_stop_callback() # when logs should be saved should_save_log = (batch_idx + 1) % self.log_save_interval == 0 or early_stop_epoch @@ -498,7 +497,6 @@ def run_training_epoch(self): # when no val loop is present or fast-dev-run still need to call checkpoints if not self.is_overridden('validation_step') and not (self.fast_dev_run or should_check_val): self.call_checkpoint_callback() - self.call_early_stop_callback() # Epoch end events with self.profiler.profile('on_epoch_end'): @@ -791,10 +789,6 @@ def call_checkpoint_callback(self): if self.checkpoint_callback is not None: self.checkpoint_callback.on_validation_end(self, self.get_model()) - def call_early_stop_callback(self): - if self.early_stop_callback: - self.early_stop_callback.on_epoch_end(self, self.get_model()) - def _with_is_last(iterable): """Pass through values from the given iterable with an added boolean indicating if this is the last item. From 4fd7cab533f3d490eee98a5d209dc8f52aa15870 Mon Sep 17 00:00:00 2001 From: Mateusz Pieniak Date: Sun, 17 May 2020 16:45:28 +0200 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f893a298b177..8a852a83ab1a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed user warning when apex was used together with learning rate schedulers ([#1873](https://github.com/PyTorchLightning/pytorch-lightning/pull/1873)) +- Fixed multiple calls of `EarlyStopping` callback ([#1751](https://github.com/PyTorchLightning/pytorch-lightning/issues/1751)) + + ## [0.7.6] - 2020-05-16 ### Added