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] Fix a bug when load checkpoints in mulit-GPUs environment. #527

Merged
merged 2 commits into from
Nov 10, 2021

Conversation

mzr1996
Copy link
Member

@mzr1996 mzr1996 commented Nov 9, 2021

Motivation

Refers to open-mmlab/mmdetection#6405

Modification

When loading a checkpoint, map the checkpoint to the CPU, instead of None in a multi-GPUs environment.

BC-breaking (Optional)

No

Use cases (Optional)

No

Checklist

Before PR:

  • Pre-commit or other linting tools are used to fix the potential lint issues.
  • Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests.
  • The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness.
  • The documentation has been modified accordingly, like docstring or example tutorials.

After PR:

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

@mzr1996 mzr1996 requested a review from Ezra-Yu November 9, 2021 10:27
@codecov
Copy link

codecov bot commented Nov 9, 2021

Codecov Report

Merging #527 (b3358d6) into master (29f5121) will increase coverage by 0.01%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #527      +/-   ##
==========================================
+ Coverage   79.48%   79.49%   +0.01%     
==========================================
  Files         106      106              
  Lines        5975     5974       -1     
  Branches      968      968              
==========================================
  Hits         4749     4749              
+ Misses       1095     1094       -1     
  Partials      131      131              
Flag Coverage Δ
unittests 79.49% <0.00%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
mmcls/apis/inference.py 20.00% <0.00%> (+0.35%) ⬆️

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 29f5121...b3358d6. Read the comment docs.

Copy link
Collaborator

@Ezra-Yu Ezra-Yu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@mzr1996 mzr1996 merged commit e0d32df into open-mmlab:master Nov 10, 2021
xcnick pushed a commit to xcnick/mmclassification that referenced this pull request Nov 11, 2021
…n-mmlab#527)

* Fix a bug when load checkpoints in mulit-GPUs environment.

* Map the weights to CPU
mzr1996 added a commit to mzr1996/mmpretrain that referenced this pull request Nov 24, 2022
…n-mmlab#527)

* Fix a bug when load checkpoints in mulit-GPUs environment.

* Map the weights to CPU
@mzr1996 mzr1996 deleted the fix-map-loc branch December 7, 2022 02:08
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.

2 participants