Skip to content

Commit

Permalink
fixed #30
Browse files Browse the repository at this point in the history
  • Loading branch information
lanpa committed Oct 12, 2017
1 parent 78e6912 commit 83b90b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion demo.py
Expand Up @@ -30,7 +30,7 @@
x[i] = np.cos(freqs[n_iter//10]*np.pi*float(i)/float(sample_rate)) # sound amplitude should in [-1, 1]
writer.add_audio('myAudio', x, n_iter)
writer.add_text('Text', 'text logged at step:'+str(n_iter), n_iter)
writer.add_text('another Text', 'another text logged at step:'+str(n_iter), n_iter)
writer.add_text('markdown Text', '''a|b\n-|-\nc|d''', n_iter)
for name, param in resnet18.named_parameters():
writer.add_histogram(name, param, n_iter)

Expand Down
2 changes: 1 addition & 1 deletion tensorboardX/summary.py
Expand Up @@ -206,6 +206,6 @@ def text(tag, text):
import json
PluginData = [SummaryMetadata.PluginData(plugin_name='text')]
smd = SummaryMetadata(plugin_data=PluginData)
tensor = TensorProto(dtype='DT_STRING', string_val=[text.encode(encoding='utf_8')])
tensor = TensorProto(dtype='DT_STRING', string_val=[text.encode(encoding='utf_8')], tensor_shape=TensorShapeProto(dim=[TensorShapeProto.Dim(size=1)]))
return Summary(value=[Summary.Value(node_name=tag, metadata=smd, tensor=tensor)])

0 comments on commit 83b90b7

Please sign in to comment.