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

Graduate ConvNeXt to main TorchVision area #5330

Merged
merged 5 commits into from
Feb 1, 2022

Conversation

datumbox
Copy link
Contributor

@datumbox datumbox commented Feb 1, 2022

Moving ConvNeXt's key classes from prototype to main area. The prototype area remains only for the Multi-weights support API.

@facebook-github-bot
Copy link

facebook-github-bot commented Feb 1, 2022

💊 CI failures summary and remediations

As of commit d40ba15 (more details on the Dr. CI page):


  • 2/2 failures introduced in this PR

🕵️ 1 new failure recognized by patterns

The following CI failures do not appear to be due to upstream breakages:

See GitHub Actions build CodeQL / build (1/1)

Step: "Build TorchVision" (full log | diagnosis details | 🔁 rerun)

2022-02-01T17:09:22.0561018Z ##[error]Process completed with exit code 1.
2022-02-01T17:09:21.8820161Z     self.finalize_options()
2022-02-01T17:09:21.8820686Z   File "/home/runner/.local/lib/python3.8/site-packages/setuptools/command/develop.py", line 52, in finalize_options
2022-02-01T17:09:21.8821140Z     easy_install.finalize_options(self)
2022-02-01T17:09:21.8822029Z   File "/home/runner/.local/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 276, in finalize_options
2022-02-01T17:09:21.8822411Z     self._fix_install_dir_for_user_site()
2022-02-01T17:09:21.8822998Z   File "/home/runner/.local/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 382, in _fix_install_dir_for_user_site
2022-02-01T17:09:21.8823392Z     self.create_home_path()
2022-02-01T17:09:21.8824112Z   File "/home/runner/.local/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 1338, in create_home_path
2022-02-01T17:09:21.8824558Z     if path.startswith(home) and not os.path.isdir(path):
2022-02-01T17:09:21.8824997Z AttributeError: 'int' object has no attribute 'startswith'
2022-02-01T17:09:22.0561018Z ##[error]Process completed with exit code 1.
2022-02-01T17:09:22.0617155Z Post job cleanup.
2022-02-01T17:09:22.2096637Z [command]/usr/bin/git version
2022-02-01T17:09:22.2157172Z git version 2.34.1
2022-02-01T17:09:22.2200859Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2022-02-01T17:09:22.2253066Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :
2022-02-01T17:09:22.2678273Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2022-02-01T17:09:22.2725237Z http.https://github.com/.extraheader
2022-02-01T17:09:22.2738318Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
2022-02-01T17:09:22.2793157Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :
2022-02-01T17:09:22.3531908Z Cleaning up orphan processes

1 failure not recognized by patterns:

Job Step Action
CircleCI cmake_macos_cpu curl -o conda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
sh conda.sh -b
source $HOME/miniconda3/bin/activate
conda install -yq conda-build cmake
packaging/build_cmake.sh
🔁 rerun

This comment was automatically generated by Dr. CI (expand for details).

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

}


class LayerNorm2d(nn.LayerNorm):
Copy link
Contributor Author

@datumbox datumbox Feb 1, 2022

Choose a reason for hiding this comment

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

Start of copy-pasted code.

return x

def forward(self, x: Tensor) -> Tensor:
return self._forward_impl(x)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

End of copy-pasted code.

Copy link
Member

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

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

Thanks @datumbox , I only have minor comments, LGTM

torchvision/models/convnext.py Outdated Show resolved Hide resolved
`"A ConvNet for the 2020s" <https://arxiv.org/abs/2201.03545>`_ paper.
Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet
progress (bool): If True, displays a progress bar of the download to stderr
Copy link
Member

Choose a reason for hiding this comment

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

should we document the kwargs here? For the RAFT models I wrote

        kwargs (dict): Parameters that will be passed to the :class:`~torchvision.models.optical_flow.RAFT` class
            to override any default.

which I would agree is still awkward, considering the RAFT class isn't even exposed in the docs for now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm... Nowhere else on the models module we use document kwargs. Perhaps that's something worth considering on the new documentation? I think it might be worth chatting about how we will use it going forwards (previously we pushed parameters that are specific to the model and that kept the model builder signatures uniform, though I'm not sure why this is good).

torchvision/models/convnext.py Outdated Show resolved Hide resolved
@datumbox datumbox merged commit 8d46ef7 into pytorch:main Feb 1, 2022
@datumbox datumbox deleted the models/convnext_graduation branch February 1, 2022 17:07
facebook-github-bot pushed a commit that referenced this pull request Feb 3, 2022
Summary:
* Graduate ConvNeXt to main TorchVision area.

* Linter and all var.

* Renaming var and making named params mandatory.

Reviewed By: kazhang

Differential Revision: D33927493

fbshipit-source-id: 12dcbd2463f6dfce7e6b53a347f0c5bfa42b3a48
@datumbox datumbox mentioned this pull request Feb 11, 2022
24 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants