TensorBoard 是 TensorFlow 內(nèi)建的過程可視化工具蛔趴,會在安裝 TensorFlow 的過程中默認安裝。如果需要使用 TensorBoard 進行可視化,需要將想要可視化的操作和變量通過 tf.summary
操作進行記錄,并通過 tf.summary.FileWriter
輸出至 events 文件绪杏,再通過讀取這個文件進行可視化绳瘟。
TensorBoard operates by reading TensorFlow events files, which contain summary data that you can generate when running TensorFlow. Here's the general lifecycle for summary data within TensorBoard.
For example, suppose you are training a convolutional neural network for recognizing MNIST digits. You'd like to record how the learning rate varies over time, and how the objective function is changing. Collect these by attaching
tf.summary.scalar
ops to the nodes that output the learning rate and loss respectively. Then, give eachscalar_summary
a meaningfultag
, like'learning rate'
or'loss function'
.