深度学习框架Tensorflow学习与应用 13.5h tf1.x 第五课 使用Tensorboard进行结构可视化,以及网络运算过程可
安装
pip install tensorboard
// usage
// --port设置避免端口一样
tensorboard --logdir="/home/hcq/pointcloud/PCDet/output/kitti_models" --port=2021
1 writer.add_scalar(‘Loss/train’, np.random.random(), i) 【常用来绘制train/val loss】
from torch.utils.tensorboard import SummaryWriter
# 按住ctrl. 鼠标点击查看源码
writer = SummaryWriter("../logs/tb_test")
# writer.add_scalar() # 标量(数)
# writer.add_image() # 图像
for i in range(100):
writer.add_scalar("y=x", i, i)
2 writer.add_image(“train_set”, img, i) 单个图片
注意 img的数据类类型: img_tensor (torch.Tensor, numpy.array, or string/blobname): Image data
def add_image(self, tag, img_tensor, global_step=None, walltime=None, dataformats='CHW'): """Add image data to summary. Note that this requires the ``pillow`` package. Args: tag (string): Data identifier img_tensor (torch.Tensor, numpy.array, or string/blobname): Image data global_step (int): Global step value to record walltime (float): Optional override default walltime (time.time()) seconds after epoch of event
add_graph计算图显示
https://www.tqwba.com/x_d/jishu/192276.html
https://blog.csdn.net/songyu0120/article/details/104129930
pytorch 打印网络回传梯度
https://blog.csdn.net/Jee_King/article/details/103017077
writer.add_scalar()学习 - lypbendlf - 博客