def execute(self, server_info, channel): api_client = write_service_pb2_grpc.TensorBoardWriterServiceStub( channel) _die_if_bad_experiment_name(self.name) _die_if_bad_experiment_description(self.description) uploader = uploader_lib.TensorBoardUploader( api_client, self.logdir, allowed_plugins=server_info_lib.allowed_plugins(server_info), upload_limits=server_info_lib.upload_limits(server_info), name=self.name, description=self.description, ) experiment_id = uploader.create_experiment() url = server_info_lib.experiment_url(server_info, experiment_id) print( "Upload started and will continue reading any new data as it's added" ) print("to the logdir. To stop uploading, press Ctrl-C.") print("View your TensorBoard live at: %s" % url) try: uploader.start_uploading() except uploader_lib.ExperimentNotFoundError: print("Experiment was deleted; uploading has been cancelled") return except KeyboardInterrupt: print() print("Upload stopped. View your TensorBoard at %s" % url) return # TODO(@nfelt): make it possible for the upload cycle to end once we # detect that no more runs are active, so this code can be reached. print("Done! View your TensorBoard at %s" % url)
def test_more_plugins(self): info = server_info_pb2.ServerInfoResponse() info.plugin_control.allowed_plugins.append("foo") info.plugin_control.allowed_plugins.append("bar") info.plugin_control.allowed_plugins.append("foo") actual = server_info.allowed_plugins(info) self.assertEqual(actual, frozenset(["foo", "bar"]))
def execute(self, server_info, channel): if self.dry_run: api_client = dry_run_stubs.DryRunTensorBoardWriterStub() else: api_client = write_service_pb2_grpc.TensorBoardWriterServiceStub( channel ) _die_if_bad_experiment_name(self.name) _die_if_bad_experiment_description(self.description) uploader = uploader_lib.TensorBoardUploader( api_client, self.logdir, allowed_plugins=server_info_lib.allowed_plugins(server_info), upload_limits=server_info_lib.upload_limits(server_info), name=self.name, description=self.description, verbosity=self.verbosity, one_shot=self.one_shot, ) if self.one_shot and not os.path.isdir(self.logdir): print("%s: No such directory." % self.logdir) print( "User specified `one_shot` mode with an unavailable " "logdir. Exiting without creating an experiment." ) return experiment_id = uploader.create_experiment() url = server_info_lib.experiment_url(server_info, experiment_id) if self.experiment_url_callback is not None: self.experiment_url_callback(url) print( "Upload started and will continue reading any new data as it's " "added to the logdir.\n\nTo stop uploading, press Ctrl-C." ) if self.dry_run: print( "\n** This is a dry run. " "No data will be sent to tensorboard.dev. **\n" ) else: print("\nView your TensorBoard live at: %s\n" % url) interrupted = False try: uploader.start_uploading() except uploader_lib.ExperimentNotFoundError: print("Experiment was deleted; uploading has been cancelled") return except KeyboardInterrupt: interrupted = True finally: end_message = "\n" if interrupted: end_message += "Interrupted." else: end_message += "Done." if not self.dry_run: end_message += " View your TensorBoard at %s" % url sys.stdout.write(end_message + "\n") sys.stdout.flush()
def execute(self, server_info, channel): if self.dry_run: api_client = dry_run_stubs.DryRunTensorBoardWriterStub() else: api_client = write_service_pb2_grpc.TensorBoardWriterServiceStub( channel ) _die_if_bad_experiment_name(self.name) _die_if_bad_experiment_description(self.description) uploader = uploader_lib.TensorBoardUploader( api_client, self.logdir, allowed_plugins=server_info_lib.allowed_plugins(server_info), upload_limits=server_info_lib.upload_limits(server_info), name=self.name, description=self.description, verbosity=self.verbosity, one_shot=self.one_shot, ) experiment_id = uploader.create_experiment() url = server_info_lib.experiment_url(server_info, experiment_id) print( "Upload started and will continue reading any new data as it's added" ) print("to the logdir. To stop uploading, press Ctrl-C.") if self.dry_run: print( "\n** This is a dry run. " "No data will be sent to tensorboard.dev. **\n" ) else: print("View your TensorBoard live at: %s" % url) try: uploader.start_uploading() except uploader_lib.ExperimentNotFoundError: print("Experiment was deleted; uploading has been cancelled") return except KeyboardInterrupt: pass finally: if not self.dry_run: print() print("Done! View your TensorBoard at %s" % url)
def execute(self): api_client = write_service_pb2_grpc.TensorBoardWriterServiceStub( self.channel) uploader = uploader_lib.TensorBoardUploader( api_client, self.args.logdir, allowed_plugins=server_info_lib.allowed_plugins(self.server_info), name=self.args.name, description=self.args.description, ) experiment_id = uploader.create_experiment() url = server_info_lib.experiment_url(self.server_info, experiment_id) # Blocks forever to continuously upload data from the logdir #print("Upload started and will continue reading any new data as it's added") #print("View your TensorBoard live at: %s" % url) #uploader.start_uploading() # Runs one upload cycle uploader._upload_once() return url
def test_scalars_only(self): info = server_info_pb2.ServerInfoResponse() info.plugin_control.allowed_plugins.append( scalars_metadata.PLUGIN_NAME) actual = server_info.allowed_plugins(info) self.assertEqual(actual, frozenset([scalars_metadata.PLUGIN_NAME]))
def test_provided_but_no_plugins(self): info = server_info_pb2.ServerInfoResponse() info.plugin_control.SetInParent() actual = server_info.allowed_plugins(info) self.assertEqual(actual, frozenset([]))
def test_old_server_no_plugins(self): info = server_info_pb2.ServerInfoResponse() actual = server_info.allowed_plugins(info) self.assertEqual(actual, frozenset([scalars_metadata.PLUGIN_NAME]))