mmdet/core/bbox/coder/obb/midpoint_offset_coder.py文件中第125行:
diag_len = torch.sqrt(torch.square(center_polys[..., 0::2]) +
torch.square(center_polys[..., 1::2]))
1.10版本以下的torch没有设置torch.square()这个函数,手动改成两个相同元素做torch.mul()就可以正常运行,即:
diag_len = torch.sqrt(
torch.mul(center_polys[..., 0::2], center_polys[..., 0::2]) +
torch.mul(center_polys[..., 1::2], center_polys[..., 1::2]))