Skip to content

Commit

Permalink
Explicitly define tensorboard directory
Browse files Browse the repository at this point in the history
  • Loading branch information
kihyuks authored May 2, 2021
1 parent 6e2a8b1 commit a36feaa
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions util/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,9 @@ def train_begin(self):
checkpoint=self.checkpoint,
directory=os.path.join(self.file_path, 'raw'),
max_to_keep=1)
self.tensorboard_dir = os.path.join(self.file_path, 'tb')
self.summary_writer = tf.summary.create_file_writer(
logdir=os.path.join(self.file_path, 'tb'))
logdir=self.tensorboard_dir)
# Initiate train iterator once
# Note that creating iterator every epoch slows down
# the training since it clears the data buffer
Expand All @@ -374,9 +375,7 @@ def train_end(self, verbose=False):
self.summary_writer.close()

if verbose:
# pylint: disable=protected-access
logdir = self.summary_writer._init_op_fn.keywords['logdir'].numpy(
).decode()
logdir = self.tensorboard_dir
event_files = [
event for event in tf.io.gfile.glob(os.path.join(logdir, '*'))
]
Expand Down

0 comments on commit a36feaa

Please sign in to comment.