网络编程
位置:首页>> 网络编程>> Python编程>> 对Tensorflow中tensorboard日志的生成与显示详解

对Tensorflow中tensorboard日志的生成与显示详解

作者:hnwolfs  发布时间:2023-07-19 20:00:44 

标签:Tensorflow,tensorboard,日志

TensorBoard是TensorFlow下的一个可视化的工具,能够帮助我们在训练大规模神经网络过程中出现的复杂且不好理解的运算。TensorBoard能展示你训练过程中绘制的图像、网络结构等。

1. 构建简单的TensorBoard日志输出


import tensorflow as tf

input1 = tf.constant([1.0, 2.0, 3.0], name="input1")

input2 = tf.Variable(tf.random_uniform([3], name="input2"))

output = tf.add_n([input1, input2], name="add")

writer = tf.summary.FileWriter("./log", tf.get_default_graph())

writer.close()

"./log":TensorBoard日志信息文件保存的位置,本代码中表示:把文件保存把在当前目录下的"log"文件夹下。

对Tensorflow中tensorboard日志的生成与显示详解

2.查看TensorBoard视图

(1)激活tensorflow使用命令:activate tensorflow

进入cmd命令提示符,然后输入activate tensorflow 激活tensorflow

对Tensorflow中tensorboard日志的生成与显示详解

对Tensorflow中tensorboard日志的生成与显示详解

(2)进入tensorboard信息文件存储的存储目录

1.切换所在的磁盘号 E:

对Tensorflow中tensorboard日志的生成与显示详解

2. 进入路径文件所在的上一级目录下

cd E:\wokespace\pycharm\可视化 “E:\wokespace\pycharm\可视化”:文件所在上一级目录的路径

对Tensorflow中tensorboard日志的生成与显示详解

对Tensorflow中tensorboard日志的生成与显示详解

(3)输入tensorboard --logdir=log,启动TensorBoard

“=log” : log为tensorboard文件所在的文件夹

对Tensorflow中tensorboard日志的生成与显示详解

(4)复制” http://DESKTOP-DPG01NO:6006”链接,并在google浏览器中打开链接

对Tensorflow中tensorboard日志的生成与显示详解

(5)在google浏览器中打开链接回车

对Tensorflow中tensorboard日志的生成与显示详解

来源:https://blog.csdn.net/hnwolfs/article/details/81122380

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com