tencent-ailab / IP-Adapter

The image prompt adapter is designed to enable a pretrained text-to-image diffusion model to generate images with image prompt.
Apache License 2.0
4.5k stars 296 forks source link

Train IP-Adapter on clothes dataset #263

Open gagbaghdas opened 5 months ago

gagbaghdas commented 5 months ago

Hey guys. I'm trying to train the IP-Adapter on clothes dataset. I'm wondering is it possible to do with the same training script as it was done for faces? of course, if the dataset have the same structure.

xiaohu2015 commented 5 months ago

https://github.com/tencent-ailab/IP-Adapter/issues/261

gagbaghdas commented 5 months ago

@xiaohu2015 so I've started the training and at the some point it seems it has been interrupted.

So here is my last checkpoint.

Screenshot 2024-01-23 at 23 43 00

And from the logs I can see the last step:

 Epoch 8, step 4988

So I need to continue the training right? if so ,how can I make so it would continue from the checkpoint? Should I just set the pre-trained-model-path to the last checkpoint ? Or there is anything else I should do?

touchwolf commented 5 months ago

To achieve the desired functionality, I suggest modifying the code as follows:

accelerator.save_state(save_path, safe_serialization=False)

This change will allow you to save the model.bin file. Afterwards, you can load it using the args.pretrained_model_name_or_path parameter in your script. Please try this approach and let me know if it works for you.

gagbaghdas commented 5 months ago

Thanks @touchwolf , will try