From 53276637e257e234011eb0ed9d46939e4832c0bb Mon Sep 17 00:00:00 2001 From: RangiLyu Date: Fri, 12 Nov 2021 12:23:55 +0800 Subject: [PATCH] Add warning --- mmdet/models/backbones/pvt.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mmdet/models/backbones/pvt.py b/mmdet/models/backbones/pvt.py index f520fa1f769..11c1eb0e8ca 100644 --- a/mmdet/models/backbones/pvt.py +++ b/mmdet/models/backbones/pvt.py @@ -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): @@ -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)