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 for MMCLS1.x not being able to get classes information in checkpoint during inference #1093

Merged
merged 2 commits into from
Oct 14, 2022

Conversation

kitecats
Copy link
Contributor

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

Let MMCLS1.x get classes information from checkpoint during inference instead of using imagenet classes initialization

Modification

Please briefly describe what modification is made in this PR.

BC-breaking (Optional)

Does the modification introduce changes that break the backward compatibility of the downstream repositories?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.

Use cases (Optional)

If this PR introduces a new feature, it is better to list some use cases here and update the documentation.

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.

…int during inference

Let MMCLS1.x get classes information from checkpoint during inference instead of using imagenet classes initialization
@CLAassistant
Copy link

CLAassistant commented Oct 13, 2022

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@mzr1996 mzr1996 left a comment

Choose a reason for hiding this comment

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

LGTM, please sign the CLA before merge the PR.

@codecov
Copy link

codecov bot commented Oct 13, 2022

Codecov Report

Base: 0.02% // Head: 91.57% // Increases project coverage by +91.55% 🎉

Coverage data is based on head (85dcf9a) compared to base (e8284a4).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##             1.x    #1093       +/-   ##
==========================================
+ Coverage   0.02%   91.57%   +91.55%     
==========================================
  Files        121      128        +7     
  Lines       8239     9603     +1364     
  Branches    1371     1508      +137     
==========================================
+ Hits           2     8794     +8792     
+ Misses      8237      624     -7613     
- Partials       0      185      +185     
Flag Coverage Δ
unittests 91.57% <ø> (+91.55%) ⬆️

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

Impacted Files Coverage Δ
mmcls/apis/inference.py 0.00% <0.00%> (ø)
mmcls/datasets/pipelines/processing.py
mmcls/data/__init__.py
mmcls/datasets/pipelines/__init__.py
mmcls/datasets/pipelines/formatting.py
mmcls/datasets/pipelines/compose.py
mmcls/data/cls_data_sample.py
mmcls/datasets/pipelines/auto_augment.py
mmcls/models/backbones/swin_transformer_v2.py 89.47% <0.00%> (ø)
mmcls/structures/cls_data_sample.py 100.00% <0.00%> (ø)
... and 124 more

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.

@mzr1996 mzr1996 changed the base branch from 1.x to dev-1.x October 14, 2022 00:25
@mzr1996
Copy link
Member

mzr1996 commented Oct 14, 2022

This PR will be merged to the dev-1.x branch and merged to the 1.x branch in the next release, thanks.

@mzr1996 mzr1996 merged commit 06c919e into open-mmlab:dev-1.x Oct 14, 2022
@tonysy tonysy added the 1.0rc Functionalities for MMClassification 1.0rc label Oct 25, 2022
mzr1996 pushed a commit to mzr1996/mmpretrain that referenced this pull request Nov 24, 2022
…ckpoint. (open-mmlab#1093)

* Fix for MMCLS1.x not being able to get classes information in checkpoint during inference

Let MMCLS1.x get classes information from checkpoint during inference instead of using imagenet classes initialization

* Update inference.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.0rc Functionalities for MMClassification 1.0rc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants