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..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,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 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) else: out_size = self.roi_layers[0].output_size