Tensorboard 可视化

博客介绍了使用TensorBoard查看Graph的步骤。先将命名值添加代码并缩进,运行session,运行代码后graph数据会保存在项目的'logs'文件夹下。接着在cmd中转到该项目,输入'tensorboard --logdir logs',复制网址到Google浏览器打开就能看到生成的Graph。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. 将想要命名的值添加代码及缩进

with tf.name_scope('input'):
    with tf.name_scope('train_data'):
        ph_train_data = tf.placeholder(tf.float32, [None, n_time_step, n_dim])
    with tf.name_scope('train_label'):
        ph_train_label = tf.placeholder(tf.float32, [None, n_classes])

2. 运行 session

init = tf.global_variables_initializer()
with tf.Session() as sess:
    sess.run(init)
    tf.summary.FileWriter("logs/", sess.graph)

3. 运行代码后,graph数据将自动保存在当前项目下的 "logs" 文件夹下

4. 打开cmd,文件夹转到要打开的 logs 所在项目,输入 tensorboard --logdir logs

复制网址到Google浏览器打开 (或者直接http://localhost:6006)即可看见生成的 Graph

          

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值