comment out cutmix in hlb_cifar (#3201)

it's no-op with multi gpu and less STEPS. also the patch was selected from the whole dataset, not from the same batch
This commit is contained in:
chenyu
2024-01-21 22:24:53 -05:00
committed by GitHub
parent e6c71f1b26
commit 836883fedc

View File

@@ -189,7 +189,6 @@ def train_cifar():
mask = make_square_mask(X.shape, mask_size)
order = list(range(0, X.shape[0]))
random.shuffle(order)
# NOTE: Memory access fault if use getitem directly
X_patch = Tensor(X.numpy()[order,...])
Y_patch = Tensor(Y.numpy()[order])
X_cutmix = Tensor.where(mask, X_patch, X)
@@ -208,7 +207,8 @@ def train_cifar():
if is_train:
X = random_crop(X, crop_size=32)
X = Tensor.where(Tensor.rand(X.shape[0],1,1,1) < 0.5, X[..., ::-1], X) # flip LR
if step >= hyp['net']['cutmix_steps']: X, Y = cutmix(X, Y, mask_size=hyp['net']['cutmix_size'])
# NOTE: to bring cutmix back, make sure it's performing on mini-batch and not the whole set
# if step >= hyp['net']['cutmix_steps']: X, Y = cutmix(X, Y, mask_size=hyp['net']['cutmix_size'])
X, Y = X.numpy(), Y.numpy()
et = time.monotonic()
print(f"shuffling {'training' if is_train else 'test'} dataset in {(et-st)*1e3:.2f} ms ({cnt})")