openai / guided-diffusion

MIT License
6.23k stars 820 forks source link

Question about the guide process #35

Open rxtx-rpud opened 2 years ago

rxtx-rpud commented 2 years ago

Hi all! I'm having trouble understanding the guide process using this repo.

I've trained a model (~10K random dog images) using unlabeled data with the following script: python3 scripts/image_train.py --data_dir ./dogDB --image_size 256 --num_channels 64 --num_res_blocks 3 --diffusion_steps 2000 --noise_schedule linear --lr 1e-4 --batch_size 8 This resulted in the 3 training files: "model_XXXX.pt, "ema_XXXX.pt" and "opt_XXXX.pt".

Then, I trained the classifier on labeled images (10 classes, dog breeds, folders and images renamed according to the repo 'improved-diffusion') using the following script: python3 scripts/classifier_train.py --data_dir ./dogBreeds --lr 1e-4 --batch_size 8 --image_size 256 --classifier_attention_resolutions 32,16,8 --classifier_depth 2 --classifier_width 128 --classifier_pool attention --classifier_resblock_updown True --classifier_use_scale_shift_norm True --classifier_use_fp16 True

Finally, I'm sampling the classifier using: python3 scripts/classifier_sample.py --attention_resolutions 32,16,8 --class_cond True --diffusion_steps 2000 --image_size 256 --learn_sigma True --noise_schedule linear --num_channels 64 --num_head_channels 64 --num_res_blocks 3 --resblock_updown True --use_fp16 True --use_scale_shift_norm True --classifier_scale 1.0 --classifier_path ./classifierRes/model050000.pt --model_path ./trainRes/model700000.pt --batch_size 10 --num_samples 20

Doing this I get only noisy images. My goal is to sample as Figure 3 of the paper.

Any help to solve this?

Thanks!

ghost commented 2 years ago

I am ready to train the guided-diffusion, and the detailed process for training I think is the same with you. Do you fix this problem now? Hoping to get your reply to help me in my work.

ghost commented 2 years ago

Excuse me, I want to know here, how long you spend in your fist training(256,~10k imges) and how many GPUs you take?

ONobody commented 1 year ago

@rxtx-rpud Have you solved this problem?

lunaryan commented 3 months ago

same here