Beispiel #1
0
def _export_scalars(args):
    with _open_file(args.export_scalars) as f:
        out = csv.writer(f)
        out.writerow(["run", "path", "tag", "value", "step"])
        for run in _list_runs_cb(args)():
            for path, _digest, reader in tfevent.scalar_readers(run.dir):
                subpath = os.path.relpath(path, run.dir)
                for tag, value, step in reader:
                    out.writerow([run.id, subpath, tag, value, step])
Beispiel #2
0
def _runs_scalars_detail(runs):
    from guild import tfevent

    data = []
    cols = [
        "run",
        "path",
        "tag",
        "val",
        "step",
    ]
    for run in runs:
        for path, _run_id, scalars in tfevent.scalar_readers(run.dir):
            rel_path = os.path.relpath(path, run.dir)
            for tag, val, step in scalars:
                data.append([run, rel_path, tag, val, step])
    return pd.DataFrame(data, columns=cols)
Beispiel #3
0
def _iter_scalar_tags(dir):
    for _path, _digest, scalars in tfevent.scalar_readers(dir):
        for s in scalars:
            yield s[0]
Beispiel #4
0
 def refresh(self, runs):
     for run in runs:
         for path, cur_digest, scalars in tfevent.scalar_readers(run.path):
             self._maybe_refresh_run_scalars(run, path, cur_digest, scalars)