tensorflow / tensorflow/tensorboard
Error loading graph in tensorboard with placeholder named "length"
Open
@nfelt is already working on this.
Since Jul 13, 2018.
plugin:graph
type:bug
- Dominant language
- TypeScript
- Stars
- 7.2k
- Forks
- 1.7k
- Avg merge
- 4d 22h
- Merged PRs (30d)
- 1
Description
Tensorflox-gpu : 1.8.0
Tensorboard : 1.8.0
Python : 3.6.5
Distribution : Ubuntu 16.04.4 LTS
Description of the problem :
When adding a graph to visualize it in tensorboard, the graph does not print.

This problem does not seem to depend on the browser (we tested chrome, firefox and safari). Also the console log of the browser shows this error :
](https://user-images.githubusercontent.com/16269358/42632350-222f19d4-85dd-11e8-81b9-a14f4b2067db.png)
Minimal example of the problem :
Import tensorflow as tf
graph = tf.Graph()
with graph.as_default():
var1 = tf.placeholder(dtype=tf.int32, shape=(None), name="wedontcare")
var2 = tf.placeholder(dtype=tf.float32, shape=(None), name="length")
with tf.Session(graph=graph) as sess:
sess.run(tf.global_variables_initializer())
writer = tf.summary.FileWriter("graph/")
writer.add_graph(sess.graph)
What we tried :
- It seems the problem occurs when the name
name="length"is specified in a placeholder. This example works fine :
Import tensorflow as tf
graph = tf.Graph()
with graph.as_default():
# No palceholder name "length"
var1 = tf.placeholder(dtype=tf.int32, shape=(None), name="wedontcare")
var2 = tf.placeholder(dtype=tf.float32, shape=(None), name="thisworks")
with tf.Session(graph=graph) as sess:
sess.run(tf.global_variables_initializer())
writer = tf.summary.FileWriter("graph/")
writer.add_graph(sess.graph)
- Also it seems we need at least two placeholders to trigger the prolbem. This example works fine :
Import tensorflow as tf
graph = tf.Graph()
with graph.as_default():
# Only one placeholder
var2 = tf.placeholder(dtype=tf.float32, shape=(None), name="length")
with tf.Session(graph=graph) as sess:
sess.run(tf.global_variables_initializer())
writer = tf.summary.FileWriter("graph/")
writer.add_graph(sess.graph)
- Finally it seems we need at least one placeholder stated before the one with
name="length"to trigger the problem. This example works fine :
Import tensorflow as tf
graph = tf.Graph()
with graph.as_default():
# the name "length" placeholder is stated first
var2 = tf.placeholder(dtype=tf.float32, shape=(None), name="length")
var1 = tf.placeholder(dtype=tf.int32, shape=(None), name="wedontcare")
with tf.Session(graph=graph) as sess:
sess.run(tf.global_variables_initializer())
writer = tf.summary.FileWriter("graph/")
writer.add_graph(sess.graph)
Note that you may have weird behaviours when overwritting the graph with newest events, so be sure to clear old events before testing a case and conclude.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.