From d9f9cae6cf3acc285499a9c2242c27f75d757b13 Mon Sep 17 00:00:00 2001 From: erenzhou <592267829@qq.com> Date: Wed, 13 Apr 2022 12:18:04 +0800 Subject: [PATCH 1/2] Update rotate_single_level_roi_extractor.py --- .../roi_extractors/rotate_single_level_roi_extractor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mmrotate/models/roi_heads/roi_extractors/rotate_single_level_roi_extractor.py b/mmrotate/models/roi_heads/roi_extractors/rotate_single_level_roi_extractor.py index 542a9c4e1..b2e47d01a 100644 --- a/mmrotate/models/roi_heads/roi_extractors/rotate_single_level_roi_extractor.py +++ b/mmrotate/models/roi_heads/roi_extractors/rotate_single_level_roi_extractor.py @@ -99,7 +99,9 @@ def forward(self, feats, rois, roi_scale_factor=None): Returns: torch.Tensor: Scaled RoI features. """ - if isinstance(self.roi_layers[0], ops.RiRoIAlignRotated): + from mmdet import digit_version, mmcv_version + if isinstance(self.roi_layers[0], ops.RiRoIAlignRotated + ) or mmcv_version == digit_version('1.4.5'): out_size = nn.modules.utils._pair(self.roi_layers[0].out_size) else: out_size = self.roi_layers[0].output_size From 739908a8a26c59ad44b062455da2932b1a76fd68 Mon Sep 17 00:00:00 2001 From: erenzhou <592267829@qq.com> Date: Wed, 13 Apr 2022 14:28:51 +0800 Subject: [PATCH 2/2] Update rotate_single_level_roi_extractor.py --- .../roi_extractors/rotate_single_level_roi_extractor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmrotate/models/roi_heads/roi_extractors/rotate_single_level_roi_extractor.py b/mmrotate/models/roi_heads/roi_extractors/rotate_single_level_roi_extractor.py index b2e47d01a..7f18138ba 100644 --- a/mmrotate/models/roi_heads/roi_extractors/rotate_single_level_roi_extractor.py +++ b/mmrotate/models/roi_heads/roi_extractors/rotate_single_level_roi_extractor.py @@ -99,7 +99,7 @@ def forward(self, feats, rois, roi_scale_factor=None): Returns: torch.Tensor: Scaled RoI features. """ - from mmdet import digit_version, mmcv_version + from mmrotate import digit_version, mmcv_version if isinstance(self.roi_layers[0], ops.RiRoIAlignRotated ) or mmcv_version == digit_version('1.4.5'): out_size = nn.modules.utils._pair(self.roi_layers[0].out_size)