Trying to execute this statement to load in the testset for LSUN in Google Colab.
testset = torchvision.datasets.LSUN(’./data’, classes=‘test’, transform=transforms)
Getting this error:
Error: ./data/test_lmdb: No such file or directory
Trying to execute this statement to load in the testset for LSUN in Google Colab.
testset = torchvision.datasets.LSUN(’./data’, classes=‘test’, transform=transforms)
Getting this error:
Error: ./data/test_lmdb: No such file or directory
I think it’s because the relative path ./data
is not being resolved. Try providing absolute paths. Or, try something like this
import os
scriptdir = os.path.dirname(__file__)
datadir = os.path.join(scriptdir,'data')
testset = torchvision.datasets.LSUN(datadir, classes = 'test', transform = transforms)
Thanks for the solution, do I need to provide a path to the download.py file which the original publisher has posted on Github or I only need path to the data file?
I think you first need to download the dataset by running something like
python download.py
from this repo.
I had downloaded the dataset but was having some problems while extracting the database, but was able to do it now.
Thanks for the solution.
Do you have any idea what is the format of the output which we get from the torchvision.datasets.LSUN function and how to convert the images to a usable format of np.arrays or tensors?