Skip to content

The behavior of EarlyStopping is not the same between 0.7.5 with 0.7.3 #1699

@nickyi1990

Description

@nickyi1990

🐛 Bug

The behavior of EarlyStopping is not the same between 0.7.5 with 0.7.3, If i set patience=1, 0.7.3 will print two epoch when the second is worse than the first, but 0.7.5 will just print the first which is not consistent with the description of patience parameter

To Reproduce

Code sample

early_stop_callback = EarlyStopping(monitor='valid_roc_auc', patience=0, mode='max', verbose=True)
# Instance Model, Trainer and train model
model = PlantModel(hparams)
trainer = pl.Trainer(gpus=[hparams.gpus],
                     max_epochs=hparams.max_epochs,
                     early_stop_callback=early_stop_callback,
                     progress_bar_refresh_rate=0,
                     num_sanity_val_steps=0,
                     profiler=True,
                     gradient_clip_val=hparams.gradient_clip_val)
trainer.fit(model)
print(trainer.early_stop_callback.wait)

Expected behavior

Environment

  • CUDA:
    - GPU:
    - GeForce RTX 2080 Ti
    - GeForce RTX 2080 Ti
    - GeForce RTX 2080 Ti
    - GeForce RTX 2080 Ti
    - available: True
    - version: 10.1
  • Packages:
    - numpy: 1.18.1
    - pyTorch_debug: False
    - pyTorch_version: 1.4.0
    - pytorch-lightning: 0.7.5
    - tensorboard: 2.2.1
    - tqdm: 4.42.1
  • System:
    - OS: Linux
    - architecture:
    - 64bit
    -
    - processor: x86_64
    - python: 3.7.6
    - version: Fixed typo in single_cpu_template #38~18.04.1-Ubuntu SMP Tue Mar 31 04:17:56 UTC 2020

Additional context

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghelp wantedOpen to be worked on

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions