Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when loading the datasets #6

Closed
Kabongosalomon opened this issue May 5, 2020 · 1 comment
Closed

Error when loading the datasets #6

Kabongosalomon opened this issue May 5, 2020 · 1 comment

Comments

@Kabongosalomon
Copy link

Hi, thank you for the clean code.

I'm having issues, trying to run this cell:

root = "./datasets"

train_sampler = None

if args.dataset == "STL10":
    train_dataset = torchvision.datasets.STL10(
        root, split="unlabeled", download=True, transform=TransformsSimCLR()
    )
elif args.dataset == "CIFAR10":
    train_dataset = torchvision.datasets.CIFAR10(
        root, download=True, transform=TransformsSimCLR()
    )
else:
    raise NotImplementedError

train_loader = torch.utils.data.DataLoader(
    train_dataset,
    batch_size=args.batch_size,
    shuffle=(train_sampler is None),
    drop_last=True,
    num_workers=args.workers,
    sampler=train_sampler,
)

This is the error message, I'm getting :

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-13-bc54d6807dbe> in <module>
      9 elif args.dataset == "CIFAR10":
     10     train_dataset = torchvision.datasets.CIFAR10(
---> 11         root, download=True, transform=TransformsSimCLR()
     12     )
     13 else:

TypeError: __init__() missing 1 required positional argument: 'size'
@Spijkervet
Copy link
Owner

Thanks for letting me know, I adjusted the notebook to comply with a more recent version of the repository :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants