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

add finish method to WandbLogger #8617

Closed
wants to merge 2 commits into from
Closed

Conversation

awaelchli
Copy link
Contributor

@awaelchli awaelchli commented Jul 29, 2021

What does this PR do?

Adds WandbLogger.finish() since WandbLogger by default operates with the global wandb.run object.
Users who want to run several experiments in the same script must manually signal wandb.finish(). With the addition of this convenience method, they don't have to import wandb first just to do this.

Fixes #8614

Before submitting

  • Was this discussed/approved via a GitHub issue? (not for typos and docs)
  • 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?
  • 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)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or internal minor changes/refactorings)

PR review

Anyone in the community is free to review the PR once the tests have passed.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:

  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • 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?

I made sure I had fun coding 🙃

@awaelchli awaelchli added feature Is an improvement or enhancement logger Related to the Loggers labels Jul 29, 2021
@awaelchli awaelchli added this to the v1.5 milestone Jul 29, 2021
@codecov
Copy link

codecov bot commented Jul 29, 2021

Codecov Report

Merging #8617 (7b7eb62) into master (c99e2fe) will decrease coverage by 0%.
The diff coverage is 50%.

@@          Coverage Diff           @@
##           master   #8617   +/-   ##
======================================
- Coverage      93%     92%   -0%     
======================================
  Files         168     168           
  Lines       13951   13953    +2     
======================================
- Hits        12909   12903    -6     
- Misses       1042    1050    +8     

@@ -246,6 +246,14 @@ def finalize(self, status: str) -> None:
if self._checkpoint_callback:
self._scan_and_log_checkpoints(self._checkpoint_callback)

def finish(self) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the difference between this, finalize, and close already on the logger base class?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, that's the reason this PR is still in draft mode. I am not sure what I want to do here yet. Mainly I want to give a user control over ending an experiment manually.

Finalize: method of the loggers mentions this is for ending an experiment, but not actually all loggers implement it this way by closing their experiments completely. Finalize is called by the fit loop at the end of fit but most loggers will allow to continue logging for example during a subsequent .test() call.

Close: This method exists, but never called by Lightning. Its purpose is unclear to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Is an improvement or enhancement logger Related to the Loggers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5-Fold with PyTorchLightning + Wandb seems to log to the same experiment
2 participants