0

These are sample code.

import tensorflow as tf const1 = tf.constant(2) const2 = tf.constant(3) add_op = tf.add(const1,const2) mul_op = tf.mul(add_op,const2) with tf.Session() as sess: result,result2 = sess.run([mul_op,add_op]) print(result) print(result2) tf.train.SummaryWriter('./',sess.graph) 

it shows message like this,

Tensor("Add:0", shape=(), dtype=int32) 

However no file generated.

1 Answer 1

1

Here is a modified code, that should run:

import tensorflow as tf const1 = tf.constant(2) const2 = tf.constant(3) add_op = tf.add(const1,const2) mul_op = tf.multiply(add_op,const2) # probably you use old version of TF with tf.Session() as sess: writer = tf.summary.FileWriter('logs', sess.graph) result,result2 = sess.run([mul_op,add_op]) writer.close() 

I removed prints, change the name of the operation to be able to run it in the new version of TF (recommend to update) put the writer on top and closed it properly at the end. Also change the log dir.

Now from the same directory which you used to run a script run the following command: tensorboard --logdir=logs. Navigate the browser and see the results.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks my version was 0.10rc, so I will update version 1

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.