How can I get the individual image in original resolution?
I guess I can get the image somewhere in the [Train the Generator] part. Listed below. But I can not figure out the exactly variable that image stored. I want to get the G’s output.
# Check how the generator is doing by saving G's output on fixed_noise
if (iters % 500 == 0) or ((epoch == num_epochs-1) and (i == len(dataloader)-1)):
with torch.no_grad():
fake = netG(fixed_noise).detach().cpu()
img_list.append(vutils.make_grid(fake, padding=2, normalize=True))
In your example the images are normalized, which is what you would need to do.
You could use torchvision.transforms.ToPILImage or alternatively normalize your generated image by yourself. Basically you would have to subtract the minimum and divide by the maximal pixel value. make_grid uses it here.
Hi,
How can I save generated images individually in the local folder (like 100 images… not in a grid) using the same above DCGAN_pytorch code on Colab please ?