简单的代码:
import tensorflow as tf
In [2]: matrix1=tf.constant([[3.,3.]])
In [3]: matrix2=tf.constant([[2.],[2.]])
with tf.Session() as sess:
...: writer = tf.summary.FileWriter('./graph', sess.graph)
...: result = sess.run(tf.matmul(matrix1, matrix2))
...: writer.close()
ipython中使用!+命令可以直接运行terminal命令。
terminal输入: tensorboard --logdir graph/
跳出:Starting TensorBoard 54 at http://amax:6006
在浏览器输入地址加端口号并在graph中查看。