From 4748c6dff2ead22f1d2785e7aa5e20e2d6db9140 Mon Sep 17 00:00:00 2001 From: Ross Wightman Date: Sat, 2 Nov 2019 17:42:55 -0700 Subject: [PATCH] Fix non-prefetch variant of Mixup. Fixes #50 --- train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/train.py b/train.py index d4dd7332..b0e18bdd 100644 --- a/train.py +++ b/train.py @@ -439,7 +439,7 @@ def train_epoch( lam = 1. if not args.mixup_off_epoch or epoch < args.mixup_off_epoch: lam = np.random.beta(args.mixup, args.mixup) - input.mul_(lam).add_(1 - lam, input.flip(0)) + input = input.mul(lam).add_(1 - lam, input.flip(0)) target = mixup_target(target, args.num_classes, lam, args.smoothing) output = model(input)