transformers icon indicating copy to clipboard operation
transformers copied to clipboard

Add ConvNeXt-V2 Model

Open IMvision12 opened this issue 2 years ago • 4 comments

What does this PR do?

Adds ConvNeXt-V2 to transformers. original repo: https://github.com/facebookresearch/ConvNeXt-V2 paper: https://arxiv.org/abs/2301.00808

Before submitting

  • [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • [ ] Did you read the contributor guideline, Pull Request section?
  • [ ] Was this discussed/approved via a Github issue or the forum? Please add a link to it if that's the case.
  • [ ] Did you make sure to update the documentation with your changes? Here are the documentation guidelines, and here are tips on formatting docstrings.
  • [x] Did you write any new necessary tests?

@alaradirik

IMvision12 avatar Jan 16 '23 10:01 IMvision12

It does look like the model code is exactly the same at a first glance (saw everything is copied from ConvNext). If that is the case, yes to re-using the code of ConvNext, but if we need to make modifications in the convnext modeling file, we should add ConvNext V2 as a new model like in the PR.

sgugger avatar Jan 17 '23 14:01 sgugger

It does look like the model code is exactly the same at a first glance (saw everything is copied from ConvNext). If that is the case, yes to re-using the code of ConvNext, but if we need to make modifications in the convnext modeling file, we should add ConvNext V2 as a new model like in the PR.

Yes, the code is almost the same, but it adds a Global Response Normalization (GRN) module and removes the layer_scale_parameter from the ConvNeXtV2Layer. Makes more sense to add it as a new model then.

CC @IMvision12

alaradirik avatar Jan 18 '23 07:01 alaradirik

Thanks for the review @alaradirik I will address all comments!

IMvision12 avatar Jan 18 '23 11:01 IMvision12

The documentation is not available anymore as the PR was closed or merged.