Beispiel #1
0
def RunsMonitor(logdir, list_runs_cb, interval=None, logspec=None, run_name_cb=None):
    state = _RunsMonitorState(logdir, logspec)
    if state.log_hparams:
        list_runs_cb = _hparam_init_support(list_runs_cb, state)
    return run_util.RunsMonitor(
        logdir, list_runs_cb, _refresh_run_cb(state), interval, run_name_cb
    )
Beispiel #2
0
 def start(self):
     if self._started:
         raise RuntimeError("already started")
     self.log_dir = util.mktempdir("guild-tensorboard-")
     self._monitor = run_util.RunsMonitor(self._list_runs, self.log_dir,
                                          TB_RUNS_MONITOR_INTERVAL)
     self._monitor.start()
     self._app = self._tb.create_app(self.log_dir,
                                     TB_REFRESH_INTERVAL,
                                     path_prefix=self._path_prefix())
     self._started = True
Beispiel #3
0
def RunsMonitor(
    logdir,
    list_runs_cb,
    interval=None,
    log_images=True,
    log_hparams=True,
    run_name_cb=None,
):
    state = _RunsMonitorState(logdir, log_images, log_hparams)
    if state.log_hparams:
        list_runs_cb = _list_runs_f(list_runs_cb, state)
    return run_util.RunsMonitor(logdir, list_runs_cb, _refresh_run_cb(state),
                                interval, run_name_cb)
Beispiel #4
0
def _view_files(args):
    with util.TempDir("guild-view-") as logdir:
        log.debug("Using logdir %s", logdir)
        list_runs_cb = lambda: runs_impl.runs_for_args(args)
        monitor = run_util.RunsMonitor(
            list_runs_cb, logdir, VIEW_FILES_REFRESH_INTERVAL)
        monitor.start()
        click.launch(logdir)
        print("Monitoring runs at %s (Press CTRL+C to quit)" % logdir)
        try:
            util.wait_forever()
        except KeyboardInterrupt:
            pass
        log.debug("Stopping")
        monitor.stop()
        log.debug("Removing logdir %s", logdir) # Handled by ctx mgr
    if util.PLATFORM != "Windows":
        cli.out()