Skip to content

Commit

Permalink
Add warning
Browse files Browse the repository at this point in the history
  • Loading branch information
RangiLyu committed Nov 12, 2021
1 parent 51ec494 commit 5327663
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mmdet/models/backbones/pvt.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ def __init__(self,
# handle the BC-breaking from https://github.com/open-mmlab/mmcv/pull/1418 # noqa
from mmdet import mmcv_version, digit_version
if mmcv_version < digit_version('1.3.17'):
warnings.warn('The legacy version of forward function in'
'SpatialReductionAttention is deprecated in'
'mmcv>=1.3.17 and will no longer support in the'
'future. Please upgrade your mmcv.')
self.forward = self.legacy_forward

def forward(self, x, hw_shape, identity=None):
Expand Down Expand Up @@ -276,7 +280,6 @@ def __init__(self,
act_cfg=act_cfg)

def forward(self, x, hw_shape):
print(x.shape)
x = self.attn(self.norm1(x), hw_shape, identity=x)
x = self.ffn(self.norm2(x), hw_shape, identity=x)

Expand Down

0 comments on commit 5327663

Please sign in to comment.