Skip to content

Wishlist: example/documentation for fine-tuning or continuing training of a model #141

Closed

Description

@Quasimondo

This is more of a newby issue, but I would find it helpful if there was an example showing how to continue training from an existing checkpoint and/or start training a new model from an existing pre-trained model. I guess it is straightforward by loading the state dict of the old model, but maybe there are certain tricks or techniques that involve the scheduler settings or other issues to watch out for.

Activity

  1. self-assigned this
    on Aug 3, 2022
  2. anton-l commented on Aug 3, 2022

    @anton-l
    Member

    Hi @Quasimondo! You're right, simply loading the model as model.from_pretrained("path") is enough to start, but we're also working on a fine-tuning tutorial for the new Latent Diffusion models in the next release :)

  3. sameeravithana commented on Aug 8, 2022

    @sameeravithana

    Hi @anton-l, does the next release contain example training scripts for text-to-image and image-to-text similar to unconditional image generation one?

  4. maito1201 commented on Aug 29, 2022

    @maito1201

    I think so too.
    exaple is for unconditional model(UNet2DModel)
    UNet2DModel doesn't seem to have a channel to receive text encoder input

    I want to build pretrained UNet2DConditionModel or entire StableDiffusionPipeline.
    (I think text encoder is perfect, I want to control the taste of the output, For example, output an image specialized for Pokemon images.)
    I'm looking forward to the next release.

  5. anton-l commented on Aug 29, 2022

    @anton-l
    Member

    @sameeravithana @maito1201 the conditional scripts are still on our TODO, but feel free to contribute a PR if you've started working on it!

  6. maito1201 commented on Aug 29, 2022

    @maito1201

    @anton-l thank you for the advice.
    Unfortunately I don't understand all the things TODO to train.
    If you welcome a broken code snippet with FIXME comment, I will create a pull request.

  7. PierreChambon commented on Sep 2, 2022

    @PierreChambon

    Hi @anton-l @maito1201, happy to help too if there are any FIXME, on my side I would like to further train on a custom dataset !

  8. maito1201 commented on Sep 3, 2022

    @maito1201

    @PierreChambon thanks for your comment.

    I've wrote it.
    #342

  9. patrickvonplaten commented on Oct 27, 2022

    @patrickvonplaten
    Contributor

    Pinging @patil-suraj here - do we have good docs for the fine-tuning example?

  10. patil-suraj commented on Oct 27, 2022

    @patil-suraj
    Contributor

    We have a working fine-tuning exampe here https://github.com/huggingface/diffusers/tree/main/examples/text_to_image#stable-diffusion-text-to-image-fine-tuning
    which shows how to fine-tune text conditioned models. The readme has command which shows how to run the example but it's not very detailed.

    I would be happy to write a detailed post/doc if there's a interest in it :)
    Also if anyone is interested in doing this or collaborating in this let me know, happy to help :)

  11. usuyama commented on Nov 30, 2022

    @usuyama

    @patil-suraj

    Thank you for the awesome fine-tuning example https://github.com/huggingface/diffusers/tree/main/examples/text_to_image

    I tried the u-net fine-tuning on our dataset, but weirdly the training loss went up.

    CleanShot 2022-11-29 at 18 14 21@2x

    Do you have the training loss curve from your training? Curious to hear your experience.

  12. sayakpaul commented on Nov 21, 2024

    @sayakpaul
    Member

    This has gone through a massive overhaul already. Cc: @stevhliu. I think this can be safely closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions