From 1b54c42c90cdf1197b5004ef16b76cc87b074725 Mon Sep 17 00:00:00 2001 From: binbbaz Date: Wed, 9 Mar 2022 22:37:44 +0400 Subject: [PATCH] Update make_patch.py Both the `train_size` and `test_size` are same . setting `test_idx = idx[train_size:test_size]` produces an empty list. `test_idx` has been set to start from `train_size` to `train_size + test_size` --- make_patch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make_patch.py b/make_patch.py index 58e40cf..065fbea 100755 --- a/make_patch.py +++ b/make_patch.py @@ -90,7 +90,7 @@ idx = np.arange(50000) np.random.shuffle(idx) training_idx = idx[:train_size] -test_idx = idx[train_size:test_size] +test_idx = idx[train_size:(train_size + test_size)] train_loader = torch.utils.data.DataLoader( dset.ImageFolder('./imagenetdata/val', transforms.Compose([