Commit 497d972e authored by Zhanghao Wu's avatar Zhanghao Wu Committed by Facebook Github Bot
Browse files

Fix Tensorboard Init (#763)

Summary:
Fix the mismatching between the parameter fed into `SummaryWriter` and the API of the latest [tensorboardX](https://github.com/lanpa/tensorboardX/blob/3e35c9b5f85e8ceb0294532d9eb772341a04c097/tensorboardX/writer.py#L192), i.e. "log_dir" -> "logdir".
Pull Request resolved: https://github.com/pytorch/fairseq/pull/763

Differential Revision: D15547192

Pulled By: myleott

fbshipit-source-id: c51b88da5ec589fb8ca5b4876bc229efeb7bf494
parent b18a3126
......@@ -225,7 +225,7 @@ class tensorboard_log_wrapper(progress_bar):
self._writers = {}
except ImportError:
print("tensorboard or required dependencies not found, "
"please see README for using tensorboard.")
"please see README for using tensorboard. (e.g. pip install tensorboardX)")
self.SummaryWriter = None
def _writer(self, key):
......@@ -233,7 +233,7 @@ class tensorboard_log_wrapper(progress_bar):
return None
if key not in self._writers:
self._writers[key] = self.SummaryWriter(
log_dir=os.path.join(self.tensorboard_logdir, key),
os.path.join(self.tensorboard_logdir, key),
)
self._writers[key].add_text('args', str(vars(self.args)))
self._writers[key].add_text('sys.argv', " ".join(sys.argv))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment