mingyuliutw / UNIT

Unsupervised Image-to-Image Translation
Other
1.98k stars 360 forks source link

Tensorboard summary writer error #56

Closed groot-1313 closed 6 years ago

groot-1313 commented 6 years ago

I am running version_01, and I am facing problems with the summary writer.

  1. this line throws the following error:

AttributeError: 'module' object has no attribute 'FileWriter'

So, I replaced it with the following line:

train_writer = tf.summary.FileWriter("%s/%s" % (opts.log,os.path.splitext(os.path.basename(opts.config))[0]))

Upon doing so the program runs fine, until this line.

The error it throws is:

in add_summary for value in summary.value: AttributeError: 'Tensor' object has no attribute 'value'

Can anybody please point out the change I need to make.

reborm commented 6 years ago

Hi, I also met this error, have you solved it?

groot-1313 commented 6 years ago

Nope, no solution yet. If you do get around it, please post it here

lolz0r commented 6 years ago

I also got this error. It looks like tensorboard has received an API-breaking release since this code was first written. We need to install the older version of tensorboard to make it work.

sudo pip install 'tensorboard==1.0.0a6'

mingyuliutw commented 6 years ago

@lolz0r Thanks a lot for the info. I did not know that the tensorboard change their API. The USAGE.md page is now updated with the correct version.

groot-1313 commented 6 years ago

Works! Thanks

mahfujau commented 6 years ago

I installed the 'tensorboard==1.0.0a6' version, but still getting the error. I am stacked on this. Thank you in advanced.

AttributeError: 'module' object has no attribute 'FileWriter'

mahfujau commented 6 years ago

Solved. Thanks.

HusainKapadia commented 6 years ago

This is a very basic tensorboard scalar log.

import numpy as np import tensorflow as tf a = np.arange(10) x = tf.convert_to_tensor(a, dtype=tf.float32) x_summ = tf.summary.scalar("X", x) writer = tf.summary.FileWriter('/tmp/logdir') writer.add_summary(x_summ)

But, I get an error in add_summary for value in summary.value: AttributeError: 'Tensor' object has no attribute 'value'. Any solution for this?

hrdkjain commented 6 years ago

try writer.add_summary(x_summ).eval() as per the stackoverflow answer

gaceladri commented 6 years ago

Same issue here. Not related with this library but the same problem with tensorboard. .eval() or reinstalling an older version of tensorboard have not solved my problem.

lenovopast17 commented 5 years ago

I get the same error as well in add_summary for value in summary.value: AttributeError: 'Tensor' object has no attribute 'value'. Any solution for this?

cottrell commented 5 years ago

I saw there is some api change, probably to do with tf 2.0. This is working for me in tf 2.0:

train_writer = tf.summary.create_file_writer('./logs/1/train')

teraoka-hiroshi commented 4 years ago

Thank you

JUNNETWORKS commented 4 years ago

I saw there is some api change, probably to do with tf 2.0. This is working for me in tf 2.0:

train_writer = tf.summary.create_file_writer('./logs/1/train')

This code works correctly!! Thank you!!

omizonly commented 4 years ago

self.writer = tf.summary.create_file_writer(log_dir)

AttributeError: module 'tensorflow._api.v1.summary' has no attribute 'create_file_writer'

i'm using tf 1.13.1 can anyone help me?

quannm3110 commented 4 years ago

@omizonly 'create_file_writer' is the api for tf 2.0 while 'FileWriter' is for tf 1.x. So you should either use 'tf.summary.FileWriter' instead.