I was thinking about that, but the DCGAN tutorial here in pytorch is using the same type of code. Though they used data.ImageFolder to create dataloader which is not working in my case so I manually created the dataloader by taking self.item in dataset class and then parameters like batch_size, shuffle…
Please take a look

image.png1203×512 37.9 KB