Open FantasticZihao opened 1 year ago
I have got it working by changing the logger.py
file as below:
import tensorflow as tf
class Logger(object):
"""Tensorboard logger."""
def __init__(self, log_dir):
"""Initialize summary writer."""
self.writer = tf.summary.create_file_writer(log_dir)
def scalar_summary(self, tag, value, step):
"""Add scalar summary."""
with self.writer.as_default():
tf.summary.scalar(tag, value, step=step)
self.writer.flush()
I have got it working by changing the
logger.py
file as below:import tensorflow as tf class Logger(object): """Tensorboard logger.""" def __init__(self, log_dir): """Initialize summary writer.""" self.writer = tf.summary.create_file_writer(log_dir) def scalar_summary(self, tag, value, step): """Add scalar summary.""" with self.writer.as_default(): tf.summary.scalar(tag, value, step=step) self.writer.flush()
Thank you. I have solved this.
When I run the code to train the model on my dataset, i met the issue 'AttributeError: module 'tensorflow' has no attribute 'Summary'' . So what can i do to solve the issue?