pytorch-lightning
pytorch-lightning copied to clipboard
Introduce `Logger.experiment_dir`
"## What does this PR do?
Introduce the property first.
Part of #14188
Next steps:
- Change
Trainer.log_dir
toexperiment_dir
andModelCheckpoint
Implementation #14640, - Update implementations of some Loggers, and maybe drop some unnecessary properties(
name
,version
, etc) - Introduce
Trainer.experiment_dir
and deprecateTrainer.log_dir
Does your PR introduce any breaking changes? If yes, please list them.
When the Logger.save_dir
is None
(DummyLogger, CometLogger(online), Deprecated LoggerCollection, etc), the Trainer.log_dir
is None
either, and the checkpoints directory is default_root_dir/name/version
.
https://github.com/Lightning-AI/lightning/blob/b33e3ef18aa8f50dd905e3762aaaa3117aa65705/src/pytorch_lightning/callbacks/model_checkpoint.py#L594-L604
Since there are many Loggers that can have a save_dir
of None, I prefer to make logger.experiment_dir
return a relative path.
cc @awaelchli
Before submitting
- [x] Was this discussed/approved via a GitHub issue? (not for typos and docs)
- [x] Did you read the contributor guideline, Pull Request section?
- [x] Did you make sure your PR does only one thing, instead of bundling different changes together?
- [x] Did you make sure to update the documentation with your changes? (if necessary)
- [ ] Did you write any new necessary tests? (not for typos and docs)
- [x] Did you verify new and existing tests pass locally with your changes?
- [x] Did you list all the breaking changes introduced by this pull request?
- [x] Did you update the CHANGELOG? (not for typos, docs, test updates, or minor internal changes/refactors)
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:
- [x] Is this pull request ready for review? (if not, please submit in draft mode)
- [x] Check that all items from Before submitting are resolved
- [x] Make sure the title is self-explanatory and the description concisely explains the PR
- [ ] Add labels and milestones (and optionally projects) to the PR so it can be classified
Did you have fun?
Make sure you had fun coding 🙃 "
If this is going to be sequenced so the properties are introduced first, and then used. I would like that you open the follow-up PR already so that we can see that things worked as expected (CI passed).
If this is going to be sequenced so the properties are introduced first, and then used. I would like that you open the follow-up PR already so that we can see that things worked as expected (CI passed).
Sure, I can open the following PR first. Should I make this to draft PR first?
Codecov Report
Merging #14508 (b33e3ef) into master (b33e3ef) will not change coverage. The diff coverage is
n/a
.
:exclamation: Current head b33e3ef differs from pull request most recent head a1119c1. Consider uploading reports for the commit a1119c1 to get more accurate results
@@ Coverage Diff @@
## master #14508 +/- ##
=======================================
Coverage 64% 64%
=======================================
Files 358 358
Lines 27057 27057
=======================================
Hits 17187 17187
Misses 9870 9870