-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
log loss per image #7278
log loss per image #7278
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am generally okay with this direction. Let's maybe not introduce the unnecessary spacing changes?
@@ -19,6 +19,7 @@ | |||
import logging | |||
import math | |||
import os | |||
import os.path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have os
module imported. I think we can reuse it.
for fname in batch['filenames']: | ||
accelerator.log({'loss_for_' + fname: loss}, step=global_step) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we accept a CLI argument for this? That will be nice no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, it's nice to have.
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Let's fix the code quality issues.
@sayakpaul Which code quality issues? What should i fix? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Just one comment. Once addressed, will ship!
parser.add_argument( | ||
"--debug-loss", | ||
action="store_true", | ||
default=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to set a default for boolean flag CLI args. If someone doesn't pass --debug-loss
it will be defaulted to False. Also, we use "_" rather than "-" even for CLI args.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clean!
Great! Could you please merge the PR? |
Let's go! |
What does this PR do?
logging loss for each image in dataset. Given that Lora datasets are usually small this feature might help to one to spot low-quality images or bad captions etc.