-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Change dict update order #1108
Change dict update order #1108
Conversation
In downstream repos like mmdetection/mmocr, some other meta information (e.g. old mmdet_version/mmocr_version) from the old checkpoint will still be saved in |
Codecov Report
@@ Coverage Diff @@
## master #1108 +/- ##
==========================================
+ Coverage 67.62% 67.98% +0.35%
==========================================
Files 159 159
Lines 10283 10416 +133
Branches 1857 1896 +39
==========================================
+ Hits 6954 7081 +127
- Misses 2964 2967 +3
- Partials 365 368 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
LGTM |
LGTM, can be merged after adding comments of explanation. |
Motivation
This PR solves problem 2 described here: open-mmlab/mmocr#292: if you run training with
cfg.resume_from = 'epoch_50.pth'
, all the checkpoints created during this resumed training (e.g.epoch_51.pth
,epoch_52.pth
,epoch_53.pth
) still continue to haveepoch
anditer
equal to the values inepoch_50.pth
.Modification
With this PR I fixed the dict update order. In particular,
meta.update(self.meta)
should be done beforemeta.update(epoch=self.epoch + 1, iter=self.iter)
becauseself.meta
containsepoch
anditer
from resumed checkpoint.