-
Notifications
You must be signed in to change notification settings - Fork 3.6k
fix dirpath
in log_dir
for CSVLogger
#16401
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
Conversation
⚡ Required checks status: All passing 🟢Groups summary🟢 pytorch_lightning: Tests workflowThese checks are required after the changes to 🟢 pytorch_lightning: Azure GPU
These checks are required after the changes to 🟢 pytorch_lightning: Azure HPU
These checks are required after the changes to 🟢 pytorch_lightning: Azure IPU
These checks are required after the changes to 🟢 pytorch_lightning: Docs
These checks are required after the changes to 🟢 mypy
These checks are required after the changes to 🟢 installThese checks are required after the changes to Thank you for your contribution! 💜
|
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.
Great catch @Borda!
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. I'd like to get @awaelchli's stamp too though
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 don't understand why you get an attribute error. The attribute/property exists on the base logger and returns None by default. So this shouldn't happen at all.
Note: Underlying inconsistency will get fixed with #14188, but I haven't had the time to complete the work.
else: | ||
dirpath = self.loggers[0].log_dir | ||
logger_ = self.loggers[0] | ||
dirpath = getattr(logger_, "log_dir", getattr(logger_, "save_dir", None)) |
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.
Why has log_dir precedence over save_dir? It should be the other way around to be consistent with the way it was before.
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.
👍 sorry for the confusion :)
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.
What I'm saying is: dirpath = getattr(logger_, "save_dir", getattr(logger_, "log_dir", None))
(the order in which we access save_dir and log_dir)
because that's how it's done in the if-else above.
this would be great! it comes from creating legacy checkpoints which have not been part of normal CI so adding it here too 🦦 |
Co-authored-by: Jirka <[email protected]>
What does this PR do?
replace the rather more robust way of obtaining
log_dir
see failing legacy testing: https://github.com/Lightning-AI/lightning/actions/runs/3938658456/jobs/6737646117
Before submitting
PR review
Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:
Did you have fun?
Make sure you had fun coding 🙃
cc @awaelchli @Borda @Blaizzy @tchaton