Skip to content

Commit

Permalink
[Fix] 'RoIAlignRotated' object has no attribute 'output_size' (#213)
Browse files Browse the repository at this point in the history
* Update rotate_single_level_roi_extractor.py

* Update rotate_single_level_roi_extractor.py
  • Loading branch information
zytx121 authored Apr 20, 2022
1 parent df125d7 commit 382c06d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 382c06d

Please # to comment.