TensorFlow-- start TensorBoard and visualize

tensorboard can visualize the built neural network, which helps to understand the internal structure and complex operations of the neural network, and displays the images and network structures drawn during the training process.

data preparation

import tensorflow as tf
with tf.name_scope('input1'):
    input1=tf.constant([1.0,2.0,3.0],name="input1")
with tf.name_scope('input2'):
    input2=tf.Variable(tf.random_uniform([3]),name="input2")
output=tf.add_n([input1,input2],name="add")
writer=tf.summary.FileWriter(r"/Users/liuming/anaconda3/bin",tf.get_default_graph())
writer.close()

Please replace the output path here, the above code can output a log file
write picture description here

run the file

  1. Navigate to the log file directory
  2. Enter tensorboard –logdir=”the directory where the log file is located”
    write picture description here
  3. Open the browser and enter the URL localhost:6006. At this time, you can see the visual interface as shown in the figure below, and the tensorboard startup is completed.
    write picture description here

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324651854&siteId=291194637