user5806421
user5806421

Reputation:

Unable to visualize graph in tensorboard

While writing the summary,

summary_writer1 = tf.train.SummaryWriter(logs_path, graph=tf.get_default_graph())

works fine and produces graph on tensorboard but doing

summary_writer2 = tf.train.SummaryWriter(logs_path, sess.graph())

produces the following error while running the code to train the model,

Traceback (most recent call last):
  File "MultiLayerPerceptron.py", line 121, in <module>
    summary_writer2 = tf.train.SummaryWriter(logs_path, graph=sess.graph())
TypeError: 'Graph' object is not callable

also what's the difference between the default graph as in summary_writer1 and graph in summar_writer2

Upvotes: 0

Views: 3135

Answers (1)

nessuno
nessuno

Reputation: 27042

There's no difference between the default graph and the sess.graph, they're the same exact graph.

The error is clear:

'Graph' object is not callable

The session object has a graph member, not a graph method. Just remove the () from graph=sess.graph() and everything will work as you expect.

Upvotes: 3

Related Questions