mmcv
mmcv copied to clipboard
Add EarlyStopHook
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.
The docstring is broken.
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
Sorry for the late reply. Have you ever used it in your own experiments?
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.
Thanks, it would be better to provide the training log.
@24hours
Any update on this?