How to load LSUN datasets

When I am trying to load LSUN data set by
testset = torchvision.datasets.LSUN(’./data’, classes=‘test’, transform=transform)

I have encountered

ValueError: Unknown LSUN class: .Options are: [‘bedroom’, ‘bridge’, ‘church_outdoor’, ‘classroom’, ‘conference_room’, ‘dining_room’, ‘kitchen’, ‘living_room’, ‘restaurant’, ‘tower’]

Is there anything wrong?

check that you are on atleast torchvision 0.1.8. This option was added 25 days ago https://github.com/pytorch/vision/commit/1b9304c0d5e79d88fe7cd9bacc39adb2df1e0c46

Any utilities/examples for scene/semantic segmentation datasets such as LSUN street scene segmentation or MNIH Massachusetts Building/Road segmentation?

I have a similar issue with the LSUN dataset:

trainlsun = torchvision.datasets.LSUN(root='/data', classes=['bedroom_train'], transform=transform)

yields

Error: /data/bedroom_train_lmdb: No such file or directory

eventhough this class argument is reported by the authors: https://github.com/pytorch/vision/blob/master/torchvision/datasets/lsun.py (line 66)

I am running pytorch 0.4.0, torchvision version seems to be 0.2.1 (I picked the latest nvidia-docker image)
Has anyone met this issue and solved it ?

Thanks

3 Likes

Do you have it downloaded?

1 Like

This block of code worked for me.

classroom_train_set = torchvision.datasets.LSUN(root='./data', classes=['classroom_train'], transform=transforms.ToTensor())