Skip to content

Commit

Permalink
Error with latest tensorflow
Browse files Browse the repository at this point in the history
The logger has this error, probably due the fact that FileWriter has been deprecated. 
'tensorboard.summary._tf.summary' has no attribute 'FileWriter

Fixed by changing 'FileWriter' to'create_file_writer'
  • Loading branch information
rra94 authored May 3, 2020
1 parent 94dd002 commit d54f584
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ class Logger(object):

def __init__(self, log_dir):
"""Initialize summary writer."""
self.writer = tf.summary.FileWriter(log_dir)
self.writer = tf.summary.create_file_writer(log_dir)

def scalar_summary(self, tag, value, step):
"""Add scalar summary."""
summary = tf.Summary(value=[tf.Summary.Value(tag=tag, simple_value=value)])
self.writer.add_summary(summary, step)
self.writer.add_summary(summary, step)

0 comments on commit d54f584

Please sign in to comment.