Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tensorboard error: 'Tensor' object has no attribute 'value'

My goal: Add arbitrary text to tensorboard.

My code:

text = "muh teeeext"
summary = tf.summary.text("Muh taaaag", tf.convert_to_tensor(text))
writer.add_summary(summary)

My error:

  File xxx, line xxx, in xxx
    writer.add_summary(summary)
  File "/home/xxx/.local/lib/python3.5/site-packages/tensorflow/python/summary/writer/writer.py", line 123, in add_summary
    for value in summary.value:
AttributeError: 'Tensor' object has no attribute 'value'
like image 964
Zuoanqh Avatar asked Oct 31 '17 08:10

Zuoanqh


1 Answers

writer.add_summary(summary) is a tensor. the tensorboard writer expects a string for the summary. To get the summary from the tensor, add an eval() to the add_summary line like so:

writer.add_summary(summary).eval()

like image 129
kernelmachine Avatar answered Nov 15 '22 04:11

kernelmachine