lightweight-gan icon indicating copy to clipboard operation
lightweight-gan copied to clipboard

Generated outputs are identical to all input images after 100,000 iterations.

Open Xeddius opened this issue 3 years ago • 10 comments

Do I not have enough data? or do I need to use the ART mode? Trying to render full body portraits of people in everyday clothing, but I can see most of the input images are identical to the output, there's nothing special being generated and no in-between images at all.

Xeddius avatar Dec 19 '20 23:12 Xeddius

@Xeddius how many images are you training on? can you show some examples?

lucidrains avatar Dec 20 '20 00:12 lucidrains

@Xeddius you can pass in a --generate-interpolation to see the "in-between" images

lucidrains avatar Dec 20 '20 00:12 lucidrains

I ended up clearing the project, I was using roughly 90 images, I'm going to try with more data and then use --generate-interpolation once it reaches a reasonable amount of iterations. Is there a way to generate smaller gif files? 430mb is a bit difficult to work with.

Xeddius avatar Dec 20 '20 00:12 Xeddius

@Xeddius yea, 90 is way too small, you will need at least 1000 to see some good interpolation

lucidrains avatar Dec 20 '20 00:12 lucidrains

@Xeddius if you are training high resolution images, you can try decreasing the number of tiles with --num_image_tiles setting

lucidrains avatar Dec 20 '20 00:12 lucidrains

I can see most of the input images are identical to the output

Just chiming in. I trained the model with less than ~200 images (256x256 resolution) recently and I faced the same issue. Interpolation was not good (very twitchy), as one can expect when the generator only knows how to copy the training data.

The training data was very diverse, which made the task even harder.

Is there a way to generate smaller gif files? 430mb is a bit difficult to work with.

%pip install moviepy
import glob

run_name = 'default'
input_path = 'results/{}/'.format(run_name)
gif_files = glob.glob(input_path + '*.gif')
import moviepy.editor as mp

input_name = sorted(gif_files)[-1]
output_name = input_name.replace('.gif', '.mp4')

clip = mp.VideoFileClip(input_name)
clip.write_videofile(output_name)

woctezuma avatar Dec 20 '20 08:12 woctezuma

@woctezuma yea, with that few images, the network is just learning the individual modes

lucidrains avatar Dec 20 '20 18:12 lucidrains

I have the same problem, I have around 200 img, I trained in a resolution of 64, and around 70000 iter I stop the training and do an interpolation, but the interpolation is just a sudden change between the real images of the dataset. How do I solve this without increasing the data?

molo32 avatar Feb 19 '21 15:02 molo32

Hi, I saw from the fastgan paper that in the fewshot learning datasets (100 ~ 300 images), their model is able to generate good interpolations (see Fig6 of the paper), does this mean that there is some differences between your implementation and theirs, and that their model maybe a better choice for few-shot datasets?

Torment123 avatar Feb 26 '21 03:02 Torment123

for low data setting: --aug-prob 0.7

fabiooshiro avatar Mar 01 '22 09:03 fabiooshiro