-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
uploader: add options --dry_run and --one_shot #3707
Conversation
cc @GalOshri |
tensorboard/uploader/uploader.py
Outdated
@@ -103,6 +104,10 @@ def __init__( | |||
verbosity: Level of verbosity, an integer. Supported value: | |||
0 - No upload statistics is printed. | |||
1 - Print upload statistics while uploading data (default). | |||
one_shot: Once uploading starts, upload only the existing data in and |
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.
Superfluous "and"
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.
Done.
tensorboard/uploader/flags_parser.py
Outdated
"--one_shot", | ||
action="store_true", | ||
help="Upload only the existing data in the logdir and then exit " | ||
"immediately, instead of keep listening for new data in the logdir.", |
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.
...instead of continuing to listen...
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.
Done.
@@ -185,6 +185,45 @@ def testHasNewDataSinceLastSummarizeReturnsTrueAfterNewTensors(self): | |||
stats.add_blob(blob_bytes=2000, is_skipped=True) | |||
self.assertEqual(stats.has_new_data_since_last_summarize(), True) | |||
|
|||
def testHasDataInitiallyReturnsFlase(self): |
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.
typo: False
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.
Done.
) | ||
self.assertEqual(stats.has_data(), True) | ||
|
||
def testHasDataReturnsTrueWithskippedTensors(self): |
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.
typo: capitalize Skipped
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.
Done.
def CreateExperiment(self, request, **kwargs): | ||
"""Create a new experiment and remember it has been created.""" | ||
del request, kwargs # Unused. | ||
return write_service_pb2.CreateExperimentResponse() |
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'm a little surprised that all the responses can be empty here (except the BlobSequence case, I see). OK, assuming you've tested a dry run with scalar, tensor, and blob data.
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.
Yep. Manually tested such logdirs with --dry_run
.
--dry_run
flag, which when enabled, causes the uploader to only read datafrom the logdir and display the statistics (if
--verbose
is the default1
) and uploadno data to the server.
DryRunTensorBoardWriterStub
.--one_shot
flag, which when enabled, causes the uploader to exit immediatelyafter all existing data in the logdir are uploaded.
data.