diff --git a/utils/core_utils.py b/utils/core_utils.py index 6fa925b5..0841ecdc 100755 --- a/utils/core_utils.py +++ b/utils/core_utils.py @@ -75,7 +75,7 @@ def __call__(self, epoch, val_loss, model, ckpt_name = 'checkpoint.pt'): elif score < self.best_score: self.counter += 1 print(f'EarlyStopping counter: {self.counter} out of {self.patience}') - if self.counter >= self.patience and epoch > self.stop_epoch: + if self.counter >= self.patience or epoch > self.stop_epoch: self.early_stop = True else: self.best_score = score