-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Add option for output shape of ViT #530
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
…ation from NLC to NCHW;
Codecov Report
@@ Coverage Diff @@
## master #530 +/- ##
=======================================
Coverage 86.78% 86.79%
=======================================
Files 101 101
Lines 5246 5249 +3
Branches 847 848 +1
=======================================
+ Hits 4553 4556 +3
Misses 533 533
Partials 160 160
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
mmseg/models/backbones/vit.py
Outdated
@@ -261,6 +263,7 @@ def __init__(self, | |||
act_cfg=dict(type='GELU'), | |||
norm_eval=False, | |||
final_norm=False, | |||
final_reshape=True, |
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.
final_reshape=True, | |
out_shape=`NCHW`, |
We may rename it as out_shape
.
mmseg/models/backbones/vit.py
Outdated
@@ -305,6 +308,7 @@ def __init__(self, | |||
|
|||
self.interpolate_mode = interpolate_mode | |||
self.final_norm = final_norm | |||
self.final_reshape = final_reshape |
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.
We may also add out_shape in ['NCHW', 'NLC']
.
* Add arg: final_reshape to control if converting output feature information from NLC to NCHW; * Fix the default value of final_reshape; * Modify arg: final_reshape to arg: out_shape; * Fix some unit test bug;
* Quick fix for the img2img tests * Remove debug lines
Add arg:final_reshape for vit to control if converting output feature information from NLC to NCHW.