-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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 comet logger to log after train #892
Fix comet logger to log after train #892
Conversation
Some tests failed, but I'm not really sure why. Looks like nothing related to what I change though... |
@rank_zero_only | ||
def finalize(self, status): | ||
self.experiment.end() | ||
self.reset_experiment() |
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 is the need for setting self._experiment
to 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.
When calling self.experiment.end()
, that experiment
won't log any more data to Comet (that was issue #760 about). That's why, if you need to log any more data you need to create an ExistingCometExperiment
. For example, to log data when testing your model after training, because when training is finalized CometLogger.finalize
is called.
With this PR, this happens automatically in the CometLogger.experiment
property, when self._experiment
is set to None
.
Tell me if anything is not clear yet :)
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 think it would be nice to write this your explanation also to code as a comment for future... 🤖
@fdelrio89 Thanks! The PR seems to work. |
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, just write the reasoning for the existing experiment (copy-paste)
@rank_zero_only | ||
def finalize(self, status): | ||
self.experiment.end() | ||
self.reset_experiment() |
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 think it would be nice to write this your explanation also to code as a comment for future... 🤖
Explains the need to use CometExistingExperiment in the CometLogger class after CometLogger.finalize.
Hello @fdelrio89! Thanks for updating this PR.
|
Good idea @Borda, I already uploaded this change to the PR. Let me know if there's anything else I can do to improve this code ✌️ |
* Fix comet logger to log after train * Add clarifying comment to COmetLogger code Explains the need to use CometExistingExperiment in the CometLogger class after CometLogger.finalize.
What does this PR do?
Fixes issue #760.
Updates the
CometLogger
class for it to support logging data after the training is done. For this anExistingCometExperiment
is created inside theCometLogger
object once the training is finalized. When this happens,CometExperiment.end
is called, which makes this object not to log any more data.PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.