improved-diffusion icon indicating copy to clipboard operation
improved-diffusion copied to clipboard

How come when I sample a 64x64 unconditional model off the shelf, I get only noise?

Open DeepTitan opened this issue 2 years ago • 17 comments

image

python scripts/image_sample.py --model_path /path/to/model.pt $MODEL_FLAGS $DIFFUSION_FLAGS

How come when I run this combination the sampled images are just static noises? I get that the model is unconditional, is that why? Or am I doing something wrong

DeepTitan avatar Mar 08 '22 06:03 DeepTitan

Dear Titan: DId you solve this problem? I have meet the similar problem that i train the model for 200000 steps, but when i sample from the pt file, only get noise image. I do not know what's the problems.....

destructive-observer avatar Mar 19 '22 07:03 destructive-observer

Same problem here, has anyone solved it?

cyprian avatar Apr 02 '22 19:04 cyprian

Do you set diffusion_steps=4000?

tiandiyijian avatar Apr 19 '22 03:04 tiandiyijian

For the record, I'm also seeing just noise with samples from both

  • imagenet64_uncond_vlb_100M_1500K.pt and
  • imagenet64_uncond_100M_1500K.pt

diffusion_steps=4000 (and tried 1000 too). Output from a newly trained network with the same structure looks correct.

badcommandorfilename avatar Jun 03 '22 01:06 badcommandorfilename

@badcommandorfilename have you resolved the problem ? some training tricks to share ?

winnechan avatar Jun 23 '22 06:06 winnechan

Hitting the same issue with imagenet64_uncond_100M_1500K.pt and 4k steps. Running with fewer diffusion steps (200, 500, 800, 1000) seems to work.

I'll get back to the thread if I find a bug. Probably some thresholding logic is missing, and image values are hitting saturation point.

gordicaleksa avatar Jul 03 '22 10:07 gordicaleksa

I encountered the same problem when training on a custom dataset (cats). To be specific, the model only produces static noise on 4000 steps. However, after another 4000 steps, it can actually produce blurred cats. So I believe more training steps may work.

hym97 avatar Jul 23 '22 22:07 hym97

Hi bro, how about sample result quality after more training steps?

lulubbb avatar Aug 23 '22 03:08 lulubbb

Hitting the same issue with imagenet64_uncond_100M_1500K.pt and 4k steps. Running with fewer diffusion steps (200, 500, 800, 1000) seems to work.

I'll get back to the thread if I find a bug. Probably some thresholding logic is missing, and image values are hitting saturation point.

Thank for your tips about reduce sample step, it seems work. But I did not know why it work?in my understand, more sample step should produce more image details, Could you give me some hints? thanks again

lulubbb avatar Aug 23 '22 03:08 lulubbb

I trained 20,000 steps for generating cat pictures. The quality of cat pictures is getting better in the first 15,000 steps. But It is hard to say whether the image quality is still improving after that. BTW, The loss did not decrease significantly after the first 4,000 steps in my case.

The result is OK but not impressive. You can check them out at https://drive.google.com/drive/folders/1-obvOanCKA0lRGeS-SFK6eiZmAVvgqhn?usp=sharing

hym97 avatar Aug 23 '22 03:08 hym97

Thanks a lot for your tips and result, I'm going to try the generation of larger resolution images, this should improve the lack of clarity, But just I guess... Thanks again!

lulubbb avatar Aug 23 '22 06:08 lulubbb

Hitting the same issue with imagenet64_uncond_100M_1500K.pt and 4k steps. Running with fewer diffusion steps (200, 500, 800, 1000) seems to work.

I'll get back to the thread if I find a bug. Probably some thresholding logic is missing, and image values are hitting saturation point.

I encountered the same issue (noise) when tried to sample from imagenet64_uncond_100M_1500K.pt and cifar10_uncond_50M_500K.pt. So should I sample with fewer diffusion steps (--diffusion_steps 1000 instead of 4000)?

GiannisPikoulis avatar Sep 20 '22 22:09 GiannisPikoulis

After using --diffusion_steps=1000 instead of 4000 for sampling from cifar10_uncond_50M_500K.pt & imagenet64_uncond_100M_1500K.pt, I started seeing clearer pictures instead of pure noise. I also tried using --diffusion_steps=4000 with the --timestep_respacing argument but that produced pure noise as well. Can't figure out why though.

GiannisPikoulis avatar Sep 21 '22 17:09 GiannisPikoulis

Hitting the same issue, and I do not know why. diffusion is really confusion

lulubbb avatar Sep 22 '22 11:09 lulubbb

I also used image_nll.py for cifar10_uncond_50M_500K.pt. Using --diffusion_steps=4000 I got 5.25 bpd while using --diffusion_steps=1000 I got a better result of 3.28 bpd which is a lot closer to the results of Table 2 in the paper.

GiannisPikoulis avatar Sep 22 '22 17:09 GiannisPikoulis

我为生成猫图片训练了 20,000 步。猫图片的质量在前 15,000 步中越来越好。但很难说在那之后图像质量是否还在提高。顺便说一句,在我的案例中,在前 4,000 步之后,损失并没有显着减少。

结果还可以,但并不令人印象深刻。您可以在https://drive.google.com/drive/folders/1-obvOanCKA0lRGeS-SFK6eiZmAVvgqhn?usp=sharing查看它们

I saw your generated results and felt that the picture was not very clear. I am using bedroom, and I feel that the generated image is a little dark. I trained 10k steps 涓嬭浇 (1) 涓嬭浇

pfeducode avatar Mar 10 '23 10:03 pfeducode

I trained 20,000 steps for generating cat pictures. The quality of cat pictures is getting better in the first 15,000 steps. But It is hard to say whether the image quality is still improving after that. BTW, The loss did not decrease significantly after the first 4,000 steps in my case.

The result is OK but not impressive. You can check them out at https://drive.google.com/drive/folders/1-obvOanCKA0lRGeS-SFK6eiZmAVvgqhn?usp=sharing

I noticed that your generated image sizes are all 256x256, may I ask how to generate 256x256 sized images? I can only generate 64x64 images with a 128x128 dataset, adjusting the image_size in script_util to 128 will show 'unsupported image size', adjusting it to 256 will show ' Error(s) in loading state_dict for UNetModel'

Dummy-System avatar Mar 25 '24 17:03 Dummy-System