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

[Improve] Use MMCV load_state_dict func in ViT/Swin #1272

Merged
merged 2 commits into from
Feb 9, 2022

Conversation

xvjiarui
Copy link
Collaborator

@xvjiarui xvjiarui commented Feb 8, 2022

Motivation

ViT/Swin backbone are using nn.Module.load_state_dict to load pre-trained model. This function will return incompatible keys instead of printing them.

Modification

Change to MMCV load_state_dict func in ViT/Swin will log out incompatible keys.

BC-breaking (Optional)

No

@codecov
Copy link

codecov bot commented Feb 8, 2022

Codecov Report

Merging #1272 (6a787b9) into master (b4314f9) will not change coverage.
The diff coverage is 50.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1272   +/-   ##
=======================================
  Coverage   90.26%   90.26%           
=======================================
  Files         130      130           
  Lines        7553     7553           
  Branches     1257     1257           
=======================================
  Hits         6818     6818           
  Misses        528      528           
  Partials      207      207           
Flag Coverage Δ
unittests 90.26% <50.00%> (ø)

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

Impacted Files Coverage Δ
mmseg/models/backbones/swin.py 83.62% <33.33%> (ø)
mmseg/models/backbones/vit.py 90.18% <66.66%> (ø)

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 b4314f9...6a787b9. Read the comment docs.

@xvjiarui xvjiarui merged commit 66b778c into open-mmlab:master Feb 9, 2022
bowenroom pushed a commit to bowenroom/mmsegmentation that referenced this pull request Feb 25, 2022
* [Improve] Use MMCV load_state_dict func in ViT/Swin

* use CheckpointLoader instead
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.

3 participants