Pytorch学习记录(二)可视化工具
作者:互联网
可视化工具 Tensorboard
- 导入tensorboard
from torch.utils.tensorboard import SummaryWriter
- 创建board,添加图表、图片
# 调用时在根目录创建文件夹log
board = SummaryWriter("log")
board.add_scalar("tag1", y_label, x_label)
# 注:若img_array不是CWH,则末尾追加dataformats
board.add_image("tag2", img_array, index)
board.close()
- 实例化(在终端启动Tensorboard,端口8080)
tensorboard --logdir=log --port=8080
标签:log,img,记录,label,Pytorch,可视化,board,tensorboard,array 来源: https://www.cnblogs.com/FreshmanXu/p/15860814.html