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

[Fix] Correctly saves _metadata of state_dict when saving checkpoints #1131

Merged
merged 1 commit into from
May 6, 2023

Conversation

Bomsw
Copy link
Contributor

@Bomsw Bomsw commented May 5, 2023

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

Fix #1128, where statde_dict._metadata of saved checkpoints becomes empty OrderedDicts

Modification

modified weights_to_cpu() in runner/checkpoint.py that it stashes _metadata of state_dicts before moving weights to cpu

BC-breaking (Optional)

N/A

Use cases (Optional)

N/A

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.

@CLAassistant
Copy link

CLAassistant commented May 5, 2023

CLA assistant check
All committers have signed the CLA.

@zhouzaida zhouzaida merged commit 49c691f into open-mmlab:main May 6, 2023
@Bomsw Bomsw deleted the Bomsw/checkpoint_metadata branch May 6, 2023 04:52
@OpenMMLab-Assistant-004
Copy link

Hi @Bomsw,

We'd like to express our appreciation for your valuable contributions to the mmengine. Your efforts have significantly aided in enhancing the project's quality.
It is our pleasure to invite you to join our community thorugh Discord_Special Interest Group (SIG) channel. This is a great place to share your experiences, discuss ideas, and connect with other like-minded people. To become a part of the SIG channel, send a message to the moderator, OpenMMLab, briefly introduce yourself and mention your open-source contributions in the #introductions channel. Our team will gladly facilitate your entry. We eagerly await your presence. Please follow this link to join us: ​https://discord.gg/UjgXkPWNqA.

If you're on WeChat, we'd also love for you to join our community there. Just add our assistant using the WeChat ID: openmmlabwx. When sending the friend request, remember to include the remark "mmsig + Github ID".

Thanks again for your awesome contribution, and we're excited to have you as part of our community!

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.

[Bug] state_dict of saved checkpoints no longer contains _metadata attribute
5 participants