Quick show and tell will be the easiest way to tell you the problem.
# Define the dataset and the loader as usual
dataset = dset.ImageFolder(root=datapath,
transform=transforms.Compose([
transforms.Resize(image_size),
#transforms.CenterCrop(image_size),
transforms.ToTensor(),
transforms.Normalize((0.5414, 0.5333, 0.5338),(0.1897, 0.1911, 0.1932))]))
dataloader = torch.utils.data.DataLoader(dataset, batch_size=64,
shuffle=False, num_workers=workers)
#load the image
data = next(iter(dataloader))
#save the image
dlX = data[0].to(device)
vutils.save_image(dlX[0], 'test.jpg')
Result of save_image
Am I missing something? or doing something wrong?
I have trained a DCGAN with this dataset with results look like this but can only post a single image)
I am attaching a link to my dropbox where you can see the result, original, and the training results
https://www.dropbox.com/sh/apbfcuezzlj1kbf/AAB_-fzU1_8oLRorZ9kWF0fAa?dl=0