Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue about loading cifar-10 data : How to train the diffusion model on cifar-10? #131

Open
youyuanyi opened this issue Nov 2, 2023 · 7 comments

Comments

@youyuanyi
Copy link

How to train the diffusion model on cifar-10?
The load_data() function in image_datasets.py can not load cifar-10 datasets directly

My train.sh is following:

MODEL_FLAGS="--image_size 32 --num_channels 128 --num_res_blocks 3 --learn_sigma True --dropout 0.3"
DIFFUSION_FLAGS="--diffusion_steps 4000 --noise_schedule cosine"
TRAIN_FLAGS="--lr 1e-4 --batch_size 128"

# Train
python scripts/image_train.py --data_dir ../data/cifar-10-batches-py $MODEL_FLAGS $DIFFUSION_FLAGS $TRAIN_FLAGS

in ../data/cifar-10-batches-py, there are data like this :
batches.meta data_batch_1 data_batch_2 data_batch_3 data_batch_4 data_batch_5 readme.html test_batch

@sibasmarak
Copy link

Hi, please try to follow the steps outlined here in the README script of the parent repository for cifar10.

@youyuanyi
Copy link
Author

Thanks for the tip! Thank you very much!

@youyuanyi
Copy link
Author

Hi, please try to follow the steps outlined here in the README script of the parent repository for cifar10.

Thanks again for your kind help! I want to train a guided diffusion on cifar-10 dataset. It seems I need to both train a diffusion model and a 32x32 classifier on cifar-10. So I have the following two issues:

  1. Is the model trained in the "improved diffusion" repository can be directly used in guided diffusion?
  2. Can a 32x32 classifier be trained on the cifar-10 data set in 'guided difffusion'? It seems like the code only support 64x64,128x128,256x256,512x512 input size

@sibasmarak
Copy link

  1. If the image sizes match (which is not the case for CIFAR), then you can directly use from improved diffusion repository.
  2. Yes, guided diffusion has no support for 32 image sizes (although, I suppose you can copy and re-use the code blocks for 32 image size from improved diffusion)

@youyuanyi
Copy link
Author

  1. If the image sizes match (which is not the case for CIFAR), then you can directly use from improved diffusion repository.
  2. Yes, guided diffusion has no support for 32 image sizes (although, I suppose you can copy and re-use the code blocks for 32 image size from improved diffusion)

Thank you! I think i got what you mean. I suppose I can adapt the input and output layer of the classifier model and fine-tune it on cifar-10.

@Tongmengjun
Copy link

How to evluate fid on cifar10? I can't find cifar10's ref batch.

@Algolzw
Copy link

Algolzw commented Oct 26, 2024

How to evluate fid on cifar10? I can't find cifar10's ref batch.

Do you find the ref batch of cifar10?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@Algolzw @sibasmarak @Tongmengjun @youyuanyi and others