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 config and code errors of swin/hrformer #1995

Merged
merged 3 commits into from Feb 22, 2023

Conversation

ly015
Copy link
Member

@ly015 ly015 commented Feb 22, 2023

Motivation

Modification

  • Fix misplaced paramwise_cfg in configs
  • Fix a bug in swin backbone initialization

BC-breaking (Optional)

Use cases (Optional)

Checklist

Before PR:

  • I have read and followed the workflow indicated in the CONTRIBUTING.md to create this PR.
  • Pre-commit or linting tools indicated in CONTRIBUTING.md are used to fix the potential lint issues.
  • Bug fixes are covered by unit tests, the case that causes the bug should be added in the unit tests.
  • New functionalities are covered by complete unit tests. If not, please add more unit tests to ensure correctness.
  • The documentation has been modified accordingly, including docstring or example tutorials.

After PR:

  • CLA has been signed and all committers have signed the CLA in this PR.

@codecov
Copy link

codecov bot commented Feb 22, 2023

Codecov Report

Base: 82.20% // Head: 82.16% // Decreases project coverage by -0.04% ⚠️

Coverage data is based on head (e4669fa) compared to base (a2b2a31).
Patch coverage: 0.00% of modified lines in pull request are covered.

❗ Current head e4669fa differs from pull request most recent head 4fa4866. Consider uploading reports for the commit 4fa4866 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           dev-1.x    #1995      +/-   ##
===========================================
- Coverage    82.20%   82.16%   -0.04%     
===========================================
  Files          214      214              
  Lines        12736    12734       -2     
  Branches      2154     2154              
===========================================
- Hits         10469    10463       -6     
- Misses        1806     1808       +2     
- Partials       461      463       +2     
Flag Coverage Δ
unittests 82.16% <0.00%> (-0.04%) ⬇️

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

Impacted Files Coverage Δ
mmpose/models/backbones/swin.py 84.32% <0.00%> (+0.25%) ⬆️
mmpose/codecs/associative_embedding.py 92.50% <0.00%> (-3.75%) ⬇️
mmpose/datasets/transforms/common_transforms.py 85.67% <0.00%> (+0.28%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Ben-Louis
Copy link
Collaborator

Ben-Louis commented Feb 22, 2023

There are still some discrepancies between the Swin model and the checkpoint from the previous version.

The following error is reported when initializing the model defined by td-hm_swin-t-p4-w7_8xb32-210e_coco-256x192:

unexpected key in source state_dict: backbone.norm0.weight, backbone.norm0.bias, backbone.norm1.weight, backbone.norm1.bias, backbone.norm2.weight, backbone.norm2.bias

Is this behaving as expected?

@Ben-Louis
Copy link
Collaborator

There are still some discrepancies between the Swin model and the checkpoint from the previous version.

The following error is reported when initializing the model defined by td-hm_swin-t-p4-w7_8xb32-210e_coco-256x192:

unexpected key in source state_dict: backbone.norm0.weight, backbone.norm0.bias, backbone.norm1.weight, backbone.norm1.bias, backbone.norm2.weight, backbone.norm2.bias

Is this behaving as expected?

I get it. Only the normalization layers that are necessary for the out_indices are constructed.

ly015 and others added 2 commits February 22, 2023 13:21
Co-authored-by: Peng Lu <penglu2097@gmail.com>
@ly015 ly015 changed the title [Fix] fix a bug in swin initialization [Fix] fix config and code errors of swin/hrformer Feb 22, 2023
@ly015 ly015 requested a review from Tau-J February 22, 2023 10:25
@ly015 ly015 merged commit 0fb7f22 into open-mmlab:dev-1.x Feb 22, 2023
@ly015 ly015 deleted the fix-swin-backbone branch February 22, 2023 19:11
shuheilocale pushed a commit to shuheilocale/mmpose that referenced this pull request May 6, 2023
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.

None yet

3 participants