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

Fix weights_save_path when logger is used + simplify path handling + better docs #2681

Merged
merged 24 commits into from
Jul 27, 2020

Conversation

awaelchli
Copy link
Member

@awaelchli awaelchli commented Jul 23, 2020

What does this PR do?

Fixes #2527, #882, #1812 and continues effort to document and protect Trainer attributes #1497 better.

  1. If user defines the Logger save dir, it will now properly work with the setting for weights_save_path.
  2. Makes sure that the weights_save_path only gets picked if it actually was changed by user.
  3. Fixed weights_save_path not getting used when logger=False
  4. Deprecated trainer.ckpt_path since it was never actually different from weights_save_path, and never used anywhere in the code base.
  5. Made sure that the checkpoint callback does not set the properties like weights_save_path, it's not needed and prevented multiple checkpoint callbacks being used.
  6. Added detailed docs about path settings

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together? Otherwise, we ask you to create a separate PR for every change.
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?
  • Did you verify new and existing tests pass locally with your changes?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

@awaelchli awaelchli added the bug Something isn't working label Jul 23, 2020
@pep8speaks
Copy link

pep8speaks commented Jul 23, 2020

Hello @awaelchli! Thanks for updating this PR.

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2020-07-26 22:50:11 UTC

@mergify mergify bot requested a review from a team July 23, 2020 22:56
@awaelchli awaelchli added the feature Is an improvement or enhancement label Jul 23, 2020
@awaelchli awaelchli changed the title Fix weights_save_path when logger is used + simplify path handling + better docs [blocked by #2685] Fix weights_save_path when logger is used + simplify path handling + better docs Jul 24, 2020
@awaelchli awaelchli changed the title [blocked by #2685] Fix weights_save_path when logger is used + simplify path handling + better docs Fix weights_save_path when logger is used + simplify path handling + better docs Jul 24, 2020
@awaelchli awaelchli marked this pull request as ready for review July 24, 2020 12:38
@Borda Borda added the docs Documentation related label Jul 25, 2020
pytorch_lightning/trainer/trainer.py Outdated Show resolved Hide resolved
pytorch_lightning/trainer/trainer.py Outdated Show resolved Hide resolved
pytorch_lightning/trainer/deprecated_api.py Show resolved Hide resolved
@@ -53,10 +47,6 @@ def configure_checkpoint_callback(self, checkpoint_callback):
if checkpoint_callback:
checkpoint_callback.save_function = self.save_checkpoint

# if weights_save_path is still none here, set to current working dir
if self.weights_save_path is None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without this what will be the path? just none?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, it will still be default_root_dir, it's just getting set in the Trainer init now.

@mergify mergify bot requested a review from a team July 27, 2020 16:49
@williamFalcon williamFalcon merged commit d039532 into master Jul 27, 2020
@williamFalcon
Copy link
Contributor

@awaelchli make sure to list the Fixed in different lines so the GH issues close automatically

Fixes a
Fixes b
...

@awaelchli
Copy link
Member Author

ok, got it, did not know, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working docs Documentation related feature Is an improvement or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

checkpoint save dir is not correctly set when _save_dir is given by wandb logger
4 participants