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] Fix EfficientMultiheadAttention in SegFormer #1037

Merged
merged 1 commit into from
Nov 14, 2021

Conversation

Junjun2016
Copy link
Collaborator

@Junjun2016 Junjun2016 commented Nov 14, 2021

Motivation

The latest MMCV(v1.3.17) include a commit open-mmlab/mmcv#1418, which break the compatibility of EfficientMultiheadAttention in MiT.

Modification

Change the forward of EfficientMultiheadAttention and add a legacy_forward.

Handle the mmcv version by this:

  # handle the BC-breaking from https://github.com/open-mmlab/mmcv/pull/1418 # noqa
  from mmseg import mmcv_version, digit_version
  if mmcv_version < digit_version('1.3.17'):
      self.forward = self.legacy_forward

Related PR open-mmlab/mmdetection#6488.

BC-breaking (Optional)

Does the modification introduce changes that break the backward-compatibility of the downstream repos?
No

@codecov
Copy link

codecov bot commented Nov 14, 2021

Codecov Report

Attention: Patch coverage is 76.19048% with 5 lines in your changes missing coverage. Please review.

Project coverage is 89.55%. Comparing base (7a1c9a5) to head (5aa97f7).
Report is 302 commits behind head on master.

Files Patch % Lines
mmseg/models/backbones/mit.py 76.19% 2 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1037      +/-   ##
==========================================
- Coverage   89.76%   89.55%   -0.21%     
==========================================
  Files         119      119              
  Lines        6605     6626      +21     
  Branches     1029     1034       +5     
==========================================
+ Hits         5929     5934       +5     
- Misses        475      488      +13     
- Partials      201      204       +3     
Flag Coverage Δ
unittests 89.55% <76.19%> (-0.21%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Junjun2016 Junjun2016 merged commit d665f6b into open-mmlab:master Nov 14, 2021
bowenroom pushed a commit to bowenroom/mmsegmentation that referenced this pull request Feb 25, 2022
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