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

Add option for output shape of ViT #530

Merged
merged 4 commits into from
May 6, 2021

Conversation

clownrat6
Copy link
Contributor

@clownrat6 clownrat6 commented May 6, 2021

Add arg:final_reshape for vit to control if converting output feature information from NLC to NCHW.

@clownrat6 clownrat6 changed the title Add arg: final_reshape to control if converting output feature information from NLC to NCHW. Add arg: final_reshape for vit May 6, 2021
@codecov
Copy link

codecov bot commented May 6, 2021

Codecov Report

Merging #530 (c5858f5) into master (f884489) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           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           
Flag Coverage Δ
unittests 86.79% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
mmseg/models/backbones/vit.py 87.95% <100.00%> (+0.19%) ⬆️

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 f884489...c5858f5. Read the comment docs.

@@ -261,6 +263,7 @@ def __init__(self,
act_cfg=dict(type='GELU'),
norm_eval=False,
final_norm=False,
final_reshape=True,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
final_reshape=True,
out_shape=`NCHW`,

We may rename it as out_shape.

@@ -305,6 +308,7 @@ def __init__(self,

self.interpolate_mode = interpolate_mode
self.final_norm = final_norm
self.final_reshape = final_reshape
Copy link
Collaborator

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'].

@clownrat6 clownrat6 removed the request for review from xiexinch May 6, 2021 05:25
@xvjiarui xvjiarui changed the title Add arg: final_reshape for vit Add option for output shape of ViT May 6, 2021
@xvjiarui xvjiarui merged commit aa9b609 into open-mmlab:master May 6, 2021
bowenroom pushed a commit to bowenroom/mmsegmentation that referenced this pull request Feb 25, 2022
* 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;
aravind-h-v pushed a commit to aravind-h-v/mmsegmentation that referenced this pull request Mar 27, 2023
* Quick fix for the img2img tests

* Remove debug lines
sibozhang pushed a commit to sibozhang/mmsegmentation that referenced this pull request Mar 22, 2024
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.

2 participants