Skip to content

Add option for output shape of ViT#530

Merged
xvjiarui merged 4 commits intoopen-mmlab:masterfrom
clownrat6:vit_final_reshape
May 6, 2021
Merged

Add option for output shape of ViT#530
xvjiarui merged 4 commits intoopen-mmlab:masterfrom
clownrat6:vit_final_reshape

Conversation

@clownrat6
Copy link
Copy Markdown
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 requested review from xiexinch and xvjiarui May 6, 2021 03:10
@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
Copy Markdown

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.

act_cfg=dict(type='GELU'),
norm_eval=False,
final_norm=False,
final_reshape=True,
Copy link
Copy Markdown
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.


self.interpolate_mode = interpolate_mode
self.final_norm = final_norm
self.final_reshape = final_reshape
Copy link
Copy Markdown
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
michaelzhang-ai pushed a commit to michaelzhang-ai/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