tensorboardX的使用

环境使用pytorch,以及tensorboardX

例子

from tensorboardX import SummaryWriter

#tensorboard --logdir="test/data/chap4/log"
SummaryWriter=SummaryWriter(logdir="data/chap4/log")

glob_step=1
for epoch in range(5):
    for step in range(10):
        SummaryWriter.add_scalar("train loss",glob_step+0.1,glob_step)
        glob_step = glob_step + 1

启动命令

tensorboard --logdir="test/data/chap4/log"

tensorboardX的使用_第1张图片

 结果

tensorboardX的使用_第2张图片

 

你可能感兴趣的:(pytorch,深度学习,python,pytorch)