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

[Feature] Support ConvNeXt #670

Merged
merged 10 commits into from
Jan 28, 2022
Merged

[Feature] Support ConvNeXt #670

merged 10 commits into from
Jan 28, 2022

Conversation

mzr1996
Copy link
Member

@mzr1996 mzr1996 commented Jan 25, 2022

Motivation

Support ConvNeXt and add converted checkpoints

Modification

As the title

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.

@codecov
Copy link

codecov bot commented Jan 25, 2022

Codecov Report

Merging #670 (9ef533b) into dev (8488a78) will increase coverage by 0.18%.
The diff coverage is 94.82%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #670      +/-   ##
==========================================
+ Coverage   82.81%   83.00%   +0.18%     
==========================================
  Files         123      124       +1     
  Lines        7293     7409     +116     
  Branches     1267     1289      +22     
==========================================
+ Hits         6040     6150     +110     
- Misses       1076     1077       +1     
- Partials      177      182       +5     
Flag Coverage Δ
unittests 83.00% <94.82%> (+0.18%) ⬆️

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

Impacted Files Coverage Δ
mmcls/models/backbones/convnext.py 94.78% <94.78%> (ø)
mmcls/models/backbones/__init__.py 100.00% <100.00%> (ø)

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 8488a78...9ef533b. Read the comment docs.

@mzr1996 mzr1996 changed the base branch from master to dev January 25, 2022 04:14
@mzr1996 mzr1996 requested a review from Ezra-Yu January 25, 2022 04:26
mmcls/models/backbones/convnext.py Show resolved Hide resolved
mmcls/models/backbones/convnext.py Show resolved Hide resolved
mmcls/models/backbones/convnext.py Outdated Show resolved Hide resolved
def __init__(self,
in_channels,
drop_path_rate=0.,
channels_last=True,
Copy link
Collaborator

@Ezra-Yu Ezra-Yu Jan 27, 2022

Choose a reason for hiding this comment

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

channels_last make users confused, users may see it as letting input tensor as shape (N, H, W, C), channel-dim in the last, but actually, It has nothing to do with the input tensor in our implement

maybe replace it with use_linear(bool)=False like timm.

mmcls/models/backbones/convnext.py Outdated Show resolved Hide resolved
mmcls/models/backbones/convnext.py Outdated Show resolved Hide resolved
mmcls/models/backbones/convnext.py Show resolved Hide resolved
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 dc456a0 into open-mmlab:dev Jan 28, 2022
@mzr1996 mzr1996 mentioned this pull request Jan 29, 2022
27 tasks
Ezra-Yu pushed a commit to Ezra-Yu/mmclassification that referenced this pull request Feb 14, 2022
* Support ConvNeXt

* Add configs of ConvNeXt

* Update dev scripts

* Update docs.

* Use new style README

* Add unit tests.

* Update README

* Imporve according to comments

* Modify refers to timm.

* Imporve according to comments
@nijkah
Copy link
Contributor

nijkah commented Feb 15, 2022

Hello, in the original paper and code, there is a mention about layer-wise decay.
Is it the future step to implement on mmcls?

@Ezra-Yu
Copy link
Collaborator

Ezra-Yu commented Feb 15, 2022

Hello, in the original paper and code, there is a mention about layer-wise decay. Is it the future step to implement on mmcls?

In the official repo, layer-wise decay is not used in the classification task but in downstream tasks like seg and det. So we have not added this feature in future plans.

And, this feature has been implemented in mmseg in open-mmlab/mmsegmentation#1216. If you want to use this in mmcls, you can transfer it from mmseg to mmcls.

@nijkah
Copy link
Contributor

nijkah commented Feb 15, 2022

@Ezra-Yu Thank for your reply.
I was considering where I have to implement layer-wise decay when using convnext for mmdetection.

mzr1996 added a commit to mzr1996/mmpretrain that referenced this pull request Nov 24, 2022
* Support ConvNeXt

* Add configs of ConvNeXt

* Update dev scripts

* Update docs.

* Use new style README

* Add unit tests.

* Update README

* Imporve according to comments

* Modify refers to timm.

* Imporve according to comments
@mzr1996 mzr1996 deleted the ConvNeXt branch December 7, 2022 02:10
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