Cannot load SVHN dataset

I am using the following code for loading MNST dataset but I cannot load SVHN dataset. Can you help me please to solve the problem?

train_dataset = datasets.MNIST(’…/data’, train=True, download=True, transform=dataset_transform)
train_loader = torch.utils.data.DataLoader(train_dataset, batch_size=batch_size, shuffle=True)

When I use

train_dataset = datasets.SVHN(’…/data’, train=True, download=True, transform=dataset_transform)
train_loader = torch.utils.data.DataLoader(train_dataset, batch_size=batch_size, shuffle=True)

I got the following error.

Traceback (most recent call last):
File “main.py”, line 45, in
test_dataset = datasets.SVHN(’…/data’, train=False, download=True, transform=dataset_transform)
TypeError: init() got an unexpected keyword argument ‘train’

you can start with reading the documentation of the SVHN dataset:
http://pytorch.org/docs/0.3.0/torchvision/datasets.html#svhn

Thank you so much. I have load the dataset. The shape of input of this dataset is 32323, on the other hand I need 28281.

How can I do that? Thanks in advanced.

You could use resize from the torchvision transformations.

@ptrblck Thank you so much. It’s working now. The problem was about the version of pytorch. I have uninstalled and installed pytorch and solve the problem.