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

[Fix] Enable to set float mlp_ratio in SwinTransformer #8670

Merged
merged 1 commit into from
Jan 29, 2023
Merged

[Fix] Enable to set float mlp_ratio in SwinTransformer #8670

merged 1 commit into from
Jan 29, 2023

Conversation

i-aki-y
Copy link
Contributor

@i-aki-y i-aki-y commented Aug 30, 2022

Motivation

In the original implementation, the mlp_ratio parameter in the SwinTransformer can be float, but the current mmdet's implementation does not support non-integer mlp_ratio (an Exception will be raised if a non-integer value is given).

I have found the same fix in mmsegmentation:
see, open-mmlab/mmsegmentation#1274

Modification

When a float mlp_ratio is given, dims of mlp's out channels are truncated to an integer.

BC-breaking (Optional)

I think this does not break BC.

Checklist

  1. Pre-commit or other linting tools are used to fix the potential lint issues.
  2. The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness.
  3. If the modification has potential influence on downstream projects, this PR should be tested with downstream projects, like MMDet or MMCls.
  4. The documentation has been modified accordingly, like docstring or example tutorials.

@CLAassistant
Copy link

CLAassistant commented Aug 30, 2022

CLA assistant check
All committers have signed the CLA.

@i-aki-y i-aki-y changed the title Enable to set float mlp_ratio in SwinTransformer [Fix] Enable to set float mlp_ratio in SwinTransformer Aug 30, 2022
@ZwwWayne ZwwWayne added this to the 2.27.0 milestone Sep 5, 2022
@ZwwWayne ZwwWayne changed the base branch from master to dev September 5, 2022 02:50
@codecov
Copy link

codecov bot commented Sep 5, 2022

Codecov Report

Base: 64.17% // Head: 64.08% // Decreases project coverage by -0.08% ⚠️

Coverage data is based on head (24ad5d2) compared to base (3b72b12).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #8670      +/-   ##
==========================================
- Coverage   64.17%   64.08%   -0.09%     
==========================================
  Files         361      361              
  Lines       29530    29525       -5     
  Branches     5020     5020              
==========================================
- Hits        18951    18922      -29     
- Misses       9576     9589      +13     
- Partials     1003     1014      +11     
Flag Coverage Δ
unittests 64.08% <ø> (-0.07%) ⬇️

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

Impacted Files Coverage Δ
mmdet/models/backbones/swin.py 81.50% <ø> (ø)
mmdet/utils/setup_env.py 68.00% <0.00%> (-24.00%) ⬇️
mmdet/datasets/builder.py 45.83% <0.00%> (-7.30%) ⬇️
mmdet/core/bbox/samplers/random_sampler.py 75.00% <0.00%> (-5.56%) ⬇️
mmdet/core/bbox/assigners/sim_ota_assigner.py 80.00% <0.00%> (-3.64%) ⬇️
mmdet/utils/misc.py 61.53% <0.00%> (-2.57%) ⬇️
mmdet/models/dense_heads/dense_test_mixins.py 40.74% <0.00%> (-2.47%) ⬇️
mmdet/models/roi_heads/test_mixins.py 50.71% <0.00%> (-2.15%) ⬇️
mmdet/core/bbox/assigners/max_iou_assigner.py 72.36% <0.00%> (-1.32%) ⬇️
mmdet/datasets/custom.py 61.25% <0.00%> (-0.21%) ⬇️
... and 2 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ZwwWayne ZwwWayne added this to In progress in Migration via automation Jan 29, 2023
@ZwwWayne ZwwWayne merged commit 4b02faf into open-mmlab:dev Jan 29, 2023
Migration automation moved this from In progress to Done Jan 29, 2023
@ZwwWayne ZwwWayne moved this from Done to To do in Migration Jan 29, 2023
@ZwwWayne
Copy link
Collaborator

We need to migrate this PR in MMDet 3.x

@ZwwWayne ZwwWayne removed this from To do in Migration Jan 29, 2023
thmegy pushed a commit to thmegy/mmdetection that referenced this pull request May 5, 2023
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.

None yet

4 participants