openai / guided-diffusion

MIT License
6.03k stars 803 forks source link

How can I get `classifier.pt` and `diffusion.pt` from `classifier_train.py`? #90

Open gymoon10 opened 1 year ago

gymoon10 commented 1 year ago

Hi, I'm Goo-Young Moon, a master's degree student at Korea University. I read your paper interestingly while investigating the research on diffusion models. But, I opened the issue as I had some problems while I was executing codes you uploaded.

I executed the classifier_train.py and tried to generate images by classifier_sample.py. According to the Classifier guidance, classifier_sample.py requires classifier.pt for classifier_path and diffusion.pt for model_path. But there exist only model.pt and opt.pt without diffusion.pt and classifier.pt.

And when I checked the classifier_train.py, def save_model() only saves model and optimizer by f"model{step:06d}.pt" and f"opt{step:06d}.pt". Eventhough I executed the classifier_train.py, I cannot sample the images by classifier_sample.py. Could you explain me how to get diffusion.pt and classifier.pt?

I'm sorry to bother you, but I'd appreciate your help. Thank you for your research and hard work.

pribadihcr commented 1 year ago

Hi @gymoon10, do you have a solution?, I have a similar problem. thanks

pribadihcr commented 1 year ago

Hi @gymoon10,

Now I know. the classifier.pt is similar with the trained model (f"model{step:06d}.pt") from script/classifier_train.py. For diffusion.pt, you need train diffusion model with script/image_train.py liike mentioned in the README section Training models.

jbnjvc10000 commented 1 year ago

Hi @gymoon10,

Now I know. the classifier.pt is similar with the trained model (f"model{step:06d}.pt") from script/classifier_train.py. For diffusion.pt, you need train diffusion model with script/image_train.py liike mentioned in the README section Training models.

so, I actually need to train two models?

2144533854 commented 11 months ago

Hi @gymoon10,

Now I know. the classifier.pt is similar with the trained model (f"model{step:06d}.pt") from script/classifier_train.py. For diffusion.pt, you need train diffusion model with script/image_train.py liike mentioned in the README section Training models.

The pefect answer. For detail,if you want train a classifier,you should run classifier_train.py,after that ,run image_train.py, in the end ,run classifier_sample.py. The model.pt from classifier_train.py consider as classifier.pt.The model.pt from image_train.py consider as diffusion.pt The detailed parameter of code follow the readme.