Skip to content

Error loading graph in tensorboard with placeholder named "length" #1283

@TanguyMoreau

Description

@TanguyMoreau

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.
image
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 :
Browser console log
![tensorboard_bug](https://user-images.githubusercontent.com/16269358/42632368-3922ab42-85dd-11e8-8f09-4e230624fbe8.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 :

  1. 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)
  1. 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)
  1. 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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions