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

add custom dataset and instruction for training on a custom dataset #54

Merged
merged 1 commit into from
Jun 24, 2021

Conversation

rom1504
Copy link
Contributor

@rom1504 rom1504 commented Jun 4, 2021

Hi,
I created a custom dataset loader taking as input jpg files in a folder.
I think this makes it easy for people discovering this repo to train on a custom dataset.
Tell me what you think.
This was useful for me to start training my own VQGAN
Thanks for this awesome paper and clean repo!

@ChristianFJung
Copy link

Big fan of this. Definitely, an advocate that this should be merged.

@rom1504 only thing I'm wondering is where you set the # of epochs? Kinda going crazy looking for it.

@rom1504
Copy link
Contributor Author

rom1504 commented Jun 17, 2021

@ChristianFJung Hi, the cli is passing arguments to pytorch lightning Trainer class, so you can check them out there https://pytorch-lightning.readthedocs.io/en/stable/api/pytorch_lightning.trainer.trainer.html#pytorch_lightning.trainer.trainer.Trainer
The parameter you want is --max_epochs (the default is 1000)
On the same topic, you may want to use the --precision 16 option to enable 16-bit precision (lower the ram usage and allow increasing the batch size, they use it in the paper, it's also needed to use the resulting vqgan model in dalle pytorch 16 bit training mode)

Edit: actually I do not recommend using 16bit, it collaspses to NaN after 20 epochs and then it's non recoverable

@rromb
Copy link
Collaborator

rromb commented Jun 22, 2021

Hi!
Thanks for the suggestion, we're currently working on an update for the paper and code and will probably include this :)

@pesser pesser merged commit f21f6da into CompVis:master Jun 24, 2021
@pesser
Copy link
Contributor

pesser commented Jun 24, 2021

Thanks, that's awesome! 🚀

@ChristianFJung
Copy link

@rom1504 what's the simplest way to sample a custom model like this?

@rom1504
Copy link
Contributor Author

rom1504 commented Jun 25, 2021

@ChristianFJung there are various ways:

  • Train a transformer with this repo (that's the method used in the paper). That'll enable you to do unconditional sampling and class based sampling
  • train a dalle model using dalle pytorch, that'll enable you to do text to image
  • use the clip + vqgan back propagation (listed in the readme of this readme), that can be used to to text to image also

The last way is the quickest to setup, other ways are more powerful but require to train other models.

@tommyMessi
Copy link

@ChristianFJung there are various ways:

* Train a transformer with this repo (that's the method used in the paper). That'll enable you to do unconditional sampling and class based sampling

* train a dalle model using dalle pytorch, that'll enable you to do text to image

* use the clip + vqgan back propagation (listed in the readme of this readme), that can be used to to text to image also

The last way is the quickest to setup, other ways are more powerful but require to train other models.

how to train transformer

@hjq133
Copy link

hjq133 commented Sep 9, 2021

@ChristianFJung there are various ways:

  • Train a transformer with this repo (that's the method used in the paper). That'll enable you to do unconditional sampling and class based sampling
  • train a dalle model using dalle pytorch, that'll enable you to do text to image
  • use the clip + vqgan back propagation (listed in the readme of this readme), that can be used to to text to image also

The last way is the quickest to setup, other ways are more powerful but require to train other models.

Thank you, can you share the config file to train an unconditional transformer on the Imagenet ? I don't know if there is anything wrong with my config file. report in the #104

@navuboy
Copy link

navuboy commented Jan 17, 2023

where to set the f value for the custom data training?

@Blackkinggg
Copy link

@ChristianFJung there are various ways:

* Train a transformer with this repo (that's the method used in the paper). That'll enable you to do unconditional sampling and class based sampling

* train a dalle model using dalle pytorch, that'll enable you to do text to image

* use the clip + vqgan back propagation (listed in the readme of this readme), that can be used to to text to image also

The last way is the quickest to setup, other ways are more powerful but require to train other models.

how to train transformer

I have the same question, have you knew it?

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

Successfully merging this pull request may close these issues.

8 participants