From fb824f4315bb40df8e4249738f1245aabbd82a50 Mon Sep 17 00:00:00 2001 From: SCoulY Date: Wed, 30 Mar 2022 10:32:49 +0100 Subject: [PATCH] fix cuda_extension support delete _pair() operation on rois to match the cuda_ext input requirement which needs a tensor instead of tuple --- mmdet/ops/crop/crop_split.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mmdet/ops/crop/crop_split.py b/mmdet/ops/crop/crop_split.py index 448a221..33f9749 100755 --- a/mmdet/ops/crop/crop_split.py +++ b/mmdet/ops/crop/crop_split.py @@ -2,7 +2,6 @@ import torch.nn as nn from torch.autograd import Function from torch.autograd.function import once_differentiable -from torch.nn.modules.utils import _pair from . import crop_split_cuda @@ -17,7 +16,7 @@ def forward(ctx, data, rois, c): ctx.height = height ctx.width = width ctx.n = n - ctx.rois = _pair(rois) + ctx.rois = rois # print(height*width*n) output = data.new_zeros(height, width, n) crop_split_cuda.crop_split_cuda_forward(data, rois, output, height, width, c, n) @@ -46,4 +45,4 @@ def __init__(self, c=2): self.c = c def forward(self, data, rois): - return crop_split(data, rois, self.c) \ No newline at end of file + return crop_split(data, rois, self.c)