From 047a5ec05f267604c3d5f33cb575316aad94e94c Mon Sep 17 00:00:00 2001 From: masafumi Date: Tue, 12 Oct 2021 23:51:46 +0900 Subject: [PATCH] Fix bugs that Mixup does not work device=cpu --- timm/data/mixup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timm/data/mixup.py b/timm/data/mixup.py index 38477548..7e382c52 100644 --- a/timm/data/mixup.py +++ b/timm/data/mixup.py @@ -214,7 +214,7 @@ class Mixup: lam = self._mix_pair(x) else: lam = self._mix_batch(x) - target = mixup_target(target, self.num_classes, lam, self.label_smoothing) + target = mixup_target(target, self.num_classes, lam, self.label_smoothing, x.device) return x, target