深度学习框架Tensorflow学习与应用 13.5h tf1.x 第五课 使用Tensorboard进行结构可视化,以及网络运算过程可
image.png

安装

  1. pip install tensorboard
  2. // usage
  3. // --port设置避免端口一样
  4. tensorboard --logdir="/home/hcq/pointcloud/PCDet/output/kitti_models" --port=2021

1 writer.add_scalar(‘Loss/train’, np.random.random(), i) 【常用来绘制train/val loss】

  1. from torch.utils.tensorboard import SummaryWriter
  2. # 按住ctrl. 鼠标点击查看源码
  3. writer = SummaryWriter("../logs/tb_test")
  4. # writer.add_scalar() # 标量(数)
  5. # writer.add_image() # 图像
  6. for i in range(100):
  7. 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 - 博客

plt可视化

P5Pytorch可视化与生态59:59

1


2