Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Resume from the latest checkpoint automatically. #6727

Merged
merged 5 commits into from
Dec 22, 2021

Conversation

Czm369
Copy link
Collaborator

@Czm369 Czm369 commented Dec 8, 2021

Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.

Motivation

Resume from the latest checkpoint automatically without specifying the path of the checkpoint.

Modification

Add a new argument auto-resume in tools/train.py and add a new function find_latest_checkpoint in mmdet/utils/misc.py.

BC-breaking (Optional)

Does the modification introduce changes that break the backward-compatibility of the downstream repos?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.

Use cases (Optional)

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

Checklist

  1. Pre-commit or other linting tools are used to fix the potential lint issues.
  2. The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness.
  3. If the modification has potential influence on downstream projects, this PR should be tested with downstream projects, like MMDet or MMCls.
  4. The documentation has been modified accordingly, like docstring or example tutorials.

@codecov
Copy link

codecov bot commented Dec 8, 2021

Codecov Report

Merging #6727 (3251093) into dev-v2.20.0 (eb1903f) will increase coverage by 0.02%.
The diff coverage is 82.75%.

Impacted file tree graph

@@               Coverage Diff               @@
##           dev-v2.20.0    #6727      +/-   ##
===============================================
+ Coverage        62.04%   62.06%   +0.02%     
===============================================
  Files              322      323       +1     
  Lines            25717    25744      +27     
  Branches          4356     4363       +7     
===============================================
+ Hits             15955    15977      +22     
- Misses            8913     8918       +5     
  Partials           849      849              
Flag Coverage Δ
unittests 62.03% <82.75%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmdet/apis/train.py 15.66% <16.66%> (-1.01%) ⬇️
mmdet/utils/__init__.py 100.00% <100.00%> (ø)
mmdet/utils/misc.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eb1903f...3251093. Read the comment docs.

@Czm369 Czm369 requested a review from hhaAndroid December 8, 2021 10:43
mmdet/utils/misc.py Outdated Show resolved Hide resolved
mmdet/apis/train.py Outdated Show resolved Hide resolved
mmdet/utils/misc.py Outdated Show resolved Hide resolved
@ZwwWayne ZwwWayne changed the title [Fix]Resume from the latest checkpoint automatically. [Feature] Resume from the latest checkpoint automatically. Dec 13, 2021
@Czm369 Czm369 requested a review from ZwwWayne December 15, 2021 07:41
mmdet/apis/train.py Outdated Show resolved Hide resolved
@ZwwWayne ZwwWayne merged commit deca532 into open-mmlab:dev-v2.20.0 Dec 22, 2021
@AronLin AronLin mentioned this pull request Dec 27, 2021
ZwwWayne pushed a commit that referenced this pull request Jul 18, 2022
* pre-commit

* pre-commit

* pre-commit

* use cfg.get() to get auto_resume in apis/train.py
ZwwWayne pushed a commit to ZwwWayne/mmdetection that referenced this pull request Jul 19, 2022
…b#6727)

* pre-commit

* pre-commit

* pre-commit

* use cfg.get() to get auto_resume in apis/train.py
@Czm369 Czm369 deleted the dev-resume branch August 20, 2022 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants