mmcv icon indicating copy to clipboard operation
mmcv copied to clipboard

Add EarlyStopHook

Open 24hours opened this issue 2 years ago • 6 comments

Motivation

Allow user to specific stopping condition depending on loss value progress. following discussion in this issue #403

Modification

Added EarlyStopHook and should_stop flag in runner to trigger stop.

BC-breaking (Optional)

No obvious BC-breaking

Use cases (Optional)

If this PR introduces a new feature, it is better to list some use cases here, and update the documentation.

Checklist

Before PR:

  • [x] I have read and followed the workflow indicated in the CONTRIBUTING.md to create this PR.
  • [x] Pre-commit or linting tools indicated in CONTRIBUTING.md are used to fix the potential lint issues.
  • [x] Bug fixes are covered by unit tests, the case that causes the bug should be added in the unit tests.
  • [x] New functionalities are covered by complete unit tests. If not, please add more unit test to ensure the correctness.
  • [x] The documentation has been modified accordingly, including docstring or example tutorials.

After PR:

  • [x] If the modification has potential influence on downstream or other related projects, this PR should be tested with some of those projects, like MMDet or MMCls.
  • [ ] CLA has been signed and all committers have signed the CLA in this PR.

24hours avatar Dec 21 '21 00:12 24hours

The docstring is broken. 图片

mzr1996 avatar Dec 21 '21 07:12 mzr1996

Hi @24hours , thanks for your contribution.

There are two points to note:

  • There are two ways to evaluate a dataset, one is to use EvalHook and the other is to set the workflow like workflow=[('train', 1), ('val', 1)]. We need to consider both of them.
  • The priority of hooks matters so we need to determine a reasonable priority for EarlyStopHook https://github.com/open-mmlab/mmcv/blob/e4b5348ebf407f0886bc11caa7ca74d2fbf693ac/mmcv/runner/base_runner.py#L503-L531

zhouzaida avatar Dec 21 '21 09:12 zhouzaida

Sorry for the late reply. Have you ever used it in your own experiments?

zhouzaida avatar Jan 18 '22 12:01 zhouzaida

Hi,

We have the requirement for internal training. However, it's not being rigorously tested in production environment yet. If you wish to, I could share our training log.

24hours avatar Jan 21 '22 00:01 24hours

Thanks, it would be better to provide the training log.

zhouzaida avatar Jan 23 '22 05:01 zhouzaida

@24hours

Any update on this?

twmht avatar Apr 26 '22 05:04 twmht