[Fix] Fix resize mix argument bug.

pull/1860/head
mzr1996 2024-01-04 18:42:07 +08:00
parent 9ac4b316f0
commit e76681e559
1 changed files with 1 additions and 1 deletions
mmpretrain/models/utils/batch_augments

View File

@ -87,7 +87,7 @@ class ResizeMix(CutMix):
(y1, y2, x1, x2), lam = self.cutmix_bbox_and_lam(img_shape, lam)
batch_inputs[:, :, y1:y2, x1:x2] = F.interpolate(
batch_inputs[index],
size=(y2 - y1, x2 - x1),
size=(int(y2 - y1), int(x2 - x1)),
mode=self.interpolation,
align_corners=False)
mixed_scores = lam * batch_scores + (1 - lam) * batch_scores[index, :]