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

discriminator loss goes to infinity #29

Open
065294847 opened this issue Jan 26, 2023 · 12 comments
Open

discriminator loss goes to infinity #29

065294847 opened this issue Jan 26, 2023 · 12 comments

Comments

@065294847
Copy link

Hi,

I'm trying to train the cvivit on a set of 10000 images. The vae-loss keeps going down, but the discriminator loss keeps rising infinity. It's easy to fool :)

Any idea what the problem is?

@lucidrains
Copy link
Owner

hmm maybe 10k images is not enough

are you doing any augmentations?

@065294847
Copy link
Author

No augmentations.

@miguelvalente
Copy link

Check the gradients and output values at every step of the way to see where it starts to go wrong.

@065294847
Copy link
Author

Thanks. It starts to jump dramatically already at step 500.

@lucidrains
Copy link
Owner

@065294847 what is your batch size and learning rate?

@065294847
Copy link
Author

Just the defaults, batch size 4, lr 3e-4

@miguelvalente
Copy link

miguelvalente commented Jan 27, 2023

Try it with a dataset that's known to work and converge. Just to rule it out.

But try to log the grads and weights across steps to have a better understanding.

@065294847
Copy link
Author

Thanks, I'll experiment a bit and report back

1 similar comment
@065294847
Copy link
Author

Thanks, I'll experiment a bit and report back

@lucidrains
Copy link
Owner

@065294847 try lowering your learning rate, or increase your effective batch size (either increase batch_size or grad_accum_every)

@lucidrains
Copy link
Owner

lucidrains commented Jan 27, 2023

@065294847 get more data too, 10k is nothing... try 100k or a million. if that isn't possible, do some basic augmentations

@065294847
Copy link
Author

Yes of course, just wanted to do a quick test first :)

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

No branches or pull requests

3 participants