mit-han-lab / data-efficient-gans

[NeurIPS 2020] Differentiable Augmentation for Data-Efficient GAN Training
https://arxiv.org/abs/2006.10738
BSD 2-Clause "Simplified" License
1.27k stars 175 forks source link

Generate images from a grayscale trained pkl file #89

Open velamini opened 2 years ago

velamini commented 2 years ago

Hello, I have trained using a 100 set of grayscale images, now I am stuck in the generate.py because it is all set for generating RGB images. I get this error:

ValueError: not enough image data

or when I changed the generate.py archive from RGB to L :

ValueError: Too many dimensions: 3 > 2.

I have searched the internet for hours and tried a lot of stuff but I am pretty new to python so I have run out of ideas of what I need to change in the generate.py to be able to have the images, can somebody please help me?

sue-up commented 2 years ago

Please make the following changes:

  1. img.permute(0, 2, 3, 1) ---> img.permute(0, 1, 2, 3)
  2. img[0] ---> img[0][0]
  3. "RGB" ---> "L"
shibbit commented 2 years ago

Please make the following changes:

  1. img.permute(0, 2, 3, 1) ---> img.permute(0, 1, 2, 3)
  2. img[0] ---> img[0][0]
  3. "RGB" ---> "L"

You are very helpful, thank you.