From 0be530a42774a9a7868ab1f7ba3f6392d6fcde9e Mon Sep 17 00:00:00 2001 From: William Falcon Date: Sun, 31 May 2020 15:20:18 -0400 Subject: [PATCH] Revert "Fixes EarlyStopping With Precision=16 (#1996)" (#2032) This reverts commit bf39cb26c57f1fd5968420e99ba351a9e0df9541. --- pytorch_lightning/callbacks/early_stopping.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytorch_lightning/callbacks/early_stopping.py b/pytorch_lightning/callbacks/early_stopping.py index 321cf0a8..61abfb87 100644 --- a/pytorch_lightning/callbacks/early_stopping.py +++ b/pytorch_lightning/callbacks/early_stopping.py @@ -107,7 +107,7 @@ class EarlyStopping(Callback): # Allow instances to be re-used self.wait = 0 self.stopped_epoch = 0 - self.best = -torch_inf if self.monitor_op(torch.Tensor(1), torch.Tensor(2))[0].item() else torch_inf + self.best = torch_inf if self.monitor_op == torch.lt else -torch_inf def on_validation_end(self, trainer, pl_module): self._run_early_stopping_check(trainer, pl_module)