-
Notifications
You must be signed in to change notification settings - Fork 668
feat(codebase/cls): support vision_transformer #403
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
feat(codebase/cls): support vision_transformer #403
Conversation
Many thansk to your review @grimoire
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will these changes in onnx2ncnn.cpp be synced to ncnn repo or not?
This week only a little part of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
* feat(codebase/cls): support vision_transformer * style(onnx2ncnn): format cpp code, upgrade mmcls version * fix(CI): upgrade mmcv to 1.4.2 * fix(onnx2ncnn): offset out of range during fuse conv reshape * docs(vision_transformer.py): update VisionTransformer desc * docs(onnx2ncnn.cpp): add more comment * feat(onnx2ncnn.cpp): revert fuse weight * docs(onnx2ncnn.cpp): add more comment * test(vision_transformer): add test case * refactor(vision_transformer.py): use symbol rewrite layer_norm * refactor(vision_transformer): fix review * fix(attention): add missing files
* feat(codebase/cls): support vision_transformer * style(onnx2ncnn): format cpp code, upgrade mmcls version * fix(CI): upgrade mmcv to 1.4.2 * fix(onnx2ncnn): offset out of range during fuse conv reshape * docs(vision_transformer.py): update VisionTransformer desc * docs(onnx2ncnn.cpp): add more comment * feat(onnx2ncnn.cpp): revert fuse weight * docs(onnx2ncnn.cpp): add more comment * test(vision_transformer): add test case * refactor(vision_transformer.py): use symbol rewrite layer_norm * refactor(vision_transformer): fix review * fix(attention): add missing files
Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily receiving feedbacks. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.
Motivation
Deploy mmcls ViT with ncnn.
Modification
vision_transformer.py
onnx2ncnn.cpp
fuse_conv_reshape
shape.cpp
code cleanupget_node_attr_from_input
function to templateBC-breaking (Optional)
resize_pos_embed
Use cases (Optional)
If this PR introduces a new feature, it is better to list some use cases here, and update the documentation.
Checklist