-
Notifications
You must be signed in to change notification settings - Fork 856
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
Write complete json log after training #1445
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1445 +/- ##
=========================================
+ Coverage 97.54% 97.8% +0.25%
=========================================
Files 55 55
Lines 1996 2140 +144
Branches 327 369 +42
=========================================
+ Hits 1947 2093 +146
+ Misses 22 19 -3
- Partials 27 28 +1
|
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.
can we clean up the naming of writing to disk on close
? or at the minimum with a comment?
@@ -131,4 +131,4 @@ def write_json(self, dict_to_write: Mapping[str, Any], filename: str) -> None: | |||
|
|||
def close(self) -> None: | |||
"""Close writer if necessary.""" | |||
pass | |||
self.write_log("log.json") |
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.
naming-wise, this (.close
) feels like the wrong place to do the actual dump to disk, it feels like some cleanup operation should be happening here instead.
If it's a special case / hard to fix class names, let's make it clear in the comments for now
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.
Good point. Refactored close() to cleanup() and added some clarifying docstrings.
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.
nice, this feels clearer!
Much thanks! |
Description of proposed changes
As part of closing the
LogManager
at the end of training, write the run log to file.This appears to have been neglected before because when the log_writer is set to
tensorboard
(the default), the TensorBoard log is written incrementally over the course of training, whereas the json log is written all at once at the end.Related issue(s)
Fixes #1439
Test plan
New unit test confirms that log is written at the end of training.
Checklist
Need help on these? Just ask!