data-efficient-gans icon indicating copy to clipboard operation
data-efficient-gans copied to clipboard

Generate images from a grayscale trained pkl file

Open velamini opened this issue 4 years ago • 2 comments

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?

velamini avatar Nov 23 '21 02:11 velamini

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"

sue-up avatar Jan 28 '22 02:01 sue-up

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.

shibbit avatar May 12 '22 09:05 shibbit