Unable to visualize graph in tensorboard
<p>While writing the summary, </p>

<pre><code>summary_writer1 = tf.train.SummaryWriter(logs_path, graph=tf.get_default_graph())
</code></pre>

<p>works fine and produces graph on tensorboard but doing </p>

<pre><code>summary_writer2 = tf.train.SummaryWriter(logs_path, sess.graph())
</code></pre>

<p>produces the following error while running the code to train the model, </p>

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

<p>also what's the difference between the default graph as in <code>summary_writer1</code> and graph in <code>summar_writer2</code></p>

<p>There's no difference between the default graph and the <code>sess.graph</code>, they're the same exact graph.</p>

<p>The error is clear: </p>

<blockquote>
  <p>'Graph' object is not callable</p>
</blockquote>

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

python machine-learning tensorflow tensorboard