diff options
| author | Ting-Chun Wang <tcwang0509@berkeley.edu> | 2017-12-19 11:43:09 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-12-19 11:43:09 -0800 |
| commit | dd05da797863a13f6e45ec0a2d2ff3c7f8142f38 (patch) | |
| tree | 50221563418c411888f8ec0df6f91483e2d65609 | |
| parent | e9e6ef6b022954953603ee8d872bce677be7a6c3 (diff) | |
| parent | 9cf2a95d76845e151d24b86a953a5fdc76a9aa7d (diff) | |
Merge pull request #5 from javl/master
Fixes webpage autorefresh and lowers default refresh rate
| -rwxr-xr-x | util/html.py | 6 | ||||
| -rwxr-xr-x | util/visualizer.py | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/util/html.py b/util/html.py index a80aa59..71c48ad 100755 --- a/util/html.py +++ b/util/html.py @@ -4,7 +4,7 @@ import os class HTML: - def __init__(self, web_dir, title, reflesh=0): + def __init__(self, web_dir, title, refresh=0): self.title = title self.web_dir = web_dir self.img_dir = os.path.join(self.web_dir, 'images') @@ -14,9 +14,9 @@ class HTML: os.makedirs(self.img_dir) self.doc = dominate.document(title=title) - if reflesh > 0: + if refresh > 0: with self.doc.head: - meta(http_equiv="reflesh", content=str(reflesh)) + meta(http_equiv="refresh", content=str(refresh)) def get_image_dir(self): return self.img_dir diff --git a/util/visualizer.py b/util/visualizer.py index f41c55a..c11904d 100755 --- a/util/visualizer.py +++ b/util/visualizer.py @@ -1,4 +1,4 @@ -### Copyright (C) 2017 NVIDIA Corporation. All rights reserved. +### Copyright (C) 2017 NVIDIA Corporation. All rights reserved. ### Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode). import numpy as np import os @@ -6,7 +6,7 @@ import ntpath import time from . import util from . import html -import scipy.misc +import scipy.misc try: from StringIO import StringIO # Python 2.7 except ImportError: @@ -66,7 +66,7 @@ class Visualizer(): util.save_image(image_numpy, img_path) # update website - webpage = html.HTML(self.web_dir, 'Experiment name = %s' % self.name, reflesh=1) + webpage = html.HTML(self.web_dir, 'Experiment name = %s' % self.name, refresh=5) for n in range(epoch, 0, -1): webpage.add_header('epoch [%d]' % n) ims = [] @@ -96,7 +96,7 @@ class Visualizer(): # errors: dictionary of error labels and values def plot_current_errors(self, errors, step): if self.tf_log: - for tag, value in errors.items(): + for tag, value in errors.items(): summary = self.tf.Summary(value=[self.tf.Summary.Value(tag=tag, simple_value=value)]) self.writer.add_summary(summary, step) |
