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

I still don't understand why increasing the batch size makes the training slower #73

Open
PGCRT opened this issue Sep 27, 2024 · 2 comments

Comments

@PGCRT
Copy link

PGCRT commented Sep 27, 2024

If using a batch size of 1, (for a 512x512 training), I got 1it/s
If i'm using a batch size of 4, I got 4.3s/it and still have plenty of VRAM (80% usage)

Do I need to divide the training steps count by the batch size value or somthing?

@kijai
Copy link
Owner

kijai commented Sep 27, 2024

That's the idea yes, probably need to adjust LR too. Iteration speed is supposed to be slower, but learning should happen faster.

@Wolchenok57
Copy link

When you use batches, you combine all images into groups of maximum 4, if the batch size is 4 (the images must be of the same size for batch training.). A batch is not a single image; it is a group of 4 (or fewer) images. In my testing, I found that a batch size other than 1 results in poor quality of output (in my case, jumbled floating limbs instead of character). You can increase the batch size if you want to stuff your VRAM with something, but I recommend letting the VRAM be free, with better results.

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