Repository: Lightning-Universe/lightning-bolts

Issue:
val_dataloader for MNIST, FashionMNIST, BinaryMNIST sets download=True
## 🐛 Bug

`val_dataloader` for MNIST, FashionMNIST, BinaryMNIST sets `download=True` but `prepare_data` already downloaded them

### To Reproduce

Steps to reproduce the behavior:

Go to:
- [mnist_datamodule](https://github.com/PyTorchLightning/pytorch-lightning-bolts/blob/5326c69065ee0c73aabc9d3f624f01e8fedc7307/pl_bolts/datamodules/mnist_datamodule.py#L113)
- [fashion_mnist_datamodule](https://github.com/PyTorchLightning/pytorch-lightning-bolts/blob/5326c69065ee0c73aabc9d3f624f01e8fedc7307/pl_bolts/datamodules/fashion_mnist_datamodule.py#L112)
- [binary_mnist_datamodule](https://github.com/PyTorchLightning/pytorch-lightning-bolts/blob/5326c69065ee0c73aabc9d3f624f01e8fedc7307/pl_bolts/datamodules/binary_mnist_datamodule.py#L114)

#### Code sample
```
def prepare_data(self):
    MNIST(self.data_dir, train=True, download=True, transform=transform_lib.ToTensor())
    MNIST(self.data_dir, train=False, download=True, transform=transform_lib.ToTensor())

def val_dataloader(self, batch_size=32, transforms=None):
    transforms = transforms or self.val_transforms or self._default_transforms()
    dataset = FashionMNIST(self.data_dir, train=True, download=True, transform=transforms) # <-- download=False ?
```

### Expected behavior
Similar to `cifar10_datamodule`:
```
def val_dataloader(self):
    transforms = self.default_transforms() if self.val_transforms is None else self.val_transforms
    dataset = self.DATASET(self.data_dir, train=True, download=False, transform=transforms, **self.extra_args)
```



Discussion:
Hi! thanks for your contribution!, great first issue!

Resolving patch:
diff --git a/pl_bolts/datamodules/binary_mnist_datamodule.py b/pl_bolts/datamodules/binary_mnist_datamodule.py
--- a/pl_bolts/datamodules/binary_mnist_datamodule.py
+++ b/pl_bolts/datamodules/binary_mnist_datamodule.py
@@ -128,7 +128,7 @@ def val_dataloader(self, batch_size=32, transforms=None):
             transforms: custom transforms
         """
         transforms = transforms or self.val_transforms or self._default_transforms()
-        dataset = BinaryMNIST(self.data_dir, train=True, download=True, transform=transforms)
+        dataset = BinaryMNIST(self.data_dir, train=True, download=False, transform=transforms)
         train_length = len(dataset)
         _, dataset_val = random_split(
             dataset,
diff --git a/pl_bolts/datamodules/fashion_mnist_datamodule.py b/pl_bolts/datamodules/fashion_mnist_datamodule.py
--- a/pl_bolts/datamodules/fashion_mnist_datamodule.py
+++ b/pl_bolts/datamodules/fashion_mnist_datamodule.py
@@ -126,7 +126,7 @@ def val_dataloader(self, batch_size=32, transforms=None):
         """
         transforms = transforms or self.val_transforms or self._default_transforms()
 
-        dataset = FashionMNIST(self.data_dir, train=True, download=True, transform=transforms)
+        dataset = FashionMNIST(self.data_dir, train=True, download=False, transform=transforms)
         train_length = len(dataset)
         _, dataset_val = random_split(
             dataset,
diff --git a/pl_bolts/datamodules/mnist_datamodule.py b/pl_bolts/datamodules/mnist_datamodule.py
--- a/pl_bolts/datamodules/mnist_datamodule.py
+++ b/pl_bolts/datamodules/mnist_datamodule.py
@@ -126,7 +126,7 @@ def val_dataloader(self, batch_size=32, transforms=None):
             transforms: custom transforms
         """
         transforms = transforms or self.val_transforms or self._default_transforms()
-        dataset = MNIST(self.data_dir, train=True, download=True, transform=transforms)
+        dataset = MNIST(self.data_dir, train=True, download=False, transform=transforms)
         train_length = len(dataset)
         _, dataset_val = random_split(
             dataset, [train_length - self.val_split, self.val_split], generator=torch.Generator().manual_seed(self.seed)


Test patch: