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

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

Open gymoon10 opened this issue 2 years ago • 4 comments

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.

gymoon10 avatar Jan 31 '23 08:01 gymoon10

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

pribadihcr avatar Apr 13 '23 02:04 pribadihcr

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.

pribadihcr avatar Apr 13 '23 05:04 pribadihcr

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?

jbnjvc10000 avatar May 05 '23 07:05 jbnjvc10000

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.

2144533854 avatar Oct 02 '23 08:10 2144533854