tensorboard中show不出来数据

tensorboard中show不出来数据,可通过在命令中加入training解决,如下:

tensorboard --logdir==training:model_dir

转载于:https://www.cnblogs.com/guo-xiang/p/7492393.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要导出TensorBoard数据,可以按照以下步骤进行操作: 1. 在启动TensorBoard时,添加参数"--samples_per_plugin scalars=0",例如:tensorboard --samples_per_plugin scalars=0。这将确保导出所有的数据而不仅仅是10000条。 2. 使用以下代码导出TensorBoard数据: ``` from tensorboard.backend.event_processing import event_accumulator # 加载日志数据 ea = event_accumulator.EventAccumulator('events.out.tfevents.1550994567.vvd-Inspiron-7557') ea.Reload() # 输出所有插件的数据键 print(ea.scalars.Keys()) # 获取指定插件的数据 val_psnr = ea.scalars.Items('val_psnr') # 输出数据的数量和内容 print(len(val_psnr)) print([(i.step, i.value) for i in val_psnr]) ``` 3. 如果想要下载没有进行平滑处理的原始数据,可以使用TensorBoard提供的下载接口"Show data download links"。下载的数据可以在本地进行平滑处理。以下是一个平滑处理数据的示例代码: ``` import pandas as pd import numpy as np import os def smooth(csv_path, weight=0.85): data = pd.read_csv(filepath_or_buffer=csv_path, header=0, names=['Step', 'Value'], dtype={'Step': np.int, 'Value': np.float}) scalar = data['Value'].values last = scalar[0] smoothed = [] for point in scalar: smoothed_val = last * weight + (1 - weight) * point smoothed.append(smoothed_val) last = smoothed_val save = pd.DataFrame({'Step': data['Step'].values, 'Value': smoothed}) save.to_csv('smooth_' + csv_path) if __name__ == '__main__': smooth('test.csv') ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值