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)