I'm new to Pytorch and torchvision. I followed a tutorial that is roughly a year old where he tried to download mnist via python and torchvision.
This is how:
import torch
from torchvision import datasets, transforms
kwargs = {'num_workers': 1, 'pin_memory': True}
train = torch.utils.data.DataLoader(
datasets.MNIST('data', train=True, download=True,
transform=transforms.Compose([transforms.ToTensor(),
transforms.Normalize((0.1307,), (0.3081,))])),
batch_size=64, shuffle=True, **kwargs)
test = torch.utils.data.DataLoader(
datasets.MNIST('data', train=False,
transform=transforms.Compose([transforms.ToTensor(),
transforms.Normalize((0.1307,), (0.3081,))])),
batch_size=64, shuffle=True, **kwargs)
Now my problem is that I get this error:
Traceback (most recent call last):
Downloading http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz to data\MNIST\raw\train-images-idx3-ubyte.gz
File "C:/Users/Nico/PycharmProjects/PyTorch/mnist.py", line 13, in transforms.Normalize((0.1307,), (0.3081,))])),
File "C:\Users\Nico\AppData\Local\Programs\Python\Python37\lib\site-packages\torchvision\datasets\mnist.py", line 68, in init self.download()
File "C:\Users\Nico\AppData\Local\Programs\Python\Python37\lib\site-packages\torchvision\datasets\mnist.py", line 143, in download download_url(url, root=self.raw_folder, filename=filename, md5=None)
File "C:\Users\Nico\AppData\Local\Programs\Python\Python37\lib\site-packages\torchvision\datasets\utils.py", line 73, in download_url reporthook=gen_bar_updater(tqdm())
TypeError: init() missing 1 required positional argument: 'total'
Do any of you guys know what I have to change, or how I can download/use them? As I said earlier I'm new to it and I don't have any clue.
I hope you guys can help me, thanks in advance.
Greetings Nico aka. Myridor