代码
from torch.utils.tensorboard import SummaryWriter
writer = SummaryWriter("logs")
for i in range(100):
writer.add_scalar("y=x", i , i)
writer.close()
运行后
生成一个文件
运行图片中命令点击网址即可查看
注中;也可以指定端口号
tensorboard --logdir=logs --port=6007
参考课程视频地址:https://www.bilibili.com/video/BV1hE411t7RN?p=8&spm_id_from=333.1007.top_right_bar_window_history.content.click