Hello everyone!
I’m trying to train a deep neural network sampling my images with replacement. In other words, if I have for example a batch size of 10, and a data-set made of (let’s say) 1000 images, I would like to create 100 batches where each sample is randomly sampled from the whole data-set.
What I’m doing is the following:
random_train_loader = torch.utils.data.DataLoader(
        torchvision.datasets.MNIST('./datasets/', train=True, transform=torchvision.transforms.ToTensor()),
        batch_size=batch_size,
        sampler=torch.utils.data.sampler.RandomSampler(torchvision.datasets.MNIST, replacement=True)
    )
for input_images, labels in iter(random_train_loader):
    # I do stuff

Sadly this build a
object of type 'type' has no len()
error.
I’ve probably misunderstood the documentation of RandomSampler, any suggestion?
Many thanks!