tensorflow / tensorflow/tensorboard

Error loading graph in tensorboard with placeholder named "length"

Open
#1,283 2 comments 0 reactions 1 assignee View on GitHub

@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.
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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.