tensorboard的使用

官方文档

# writer.add_scalar()  # 添加标量
"""
Args:
tag (string): Data identifier # 图表的Title
scalar_value (float or string/blobname): Value to save # 对应的y轴
global_step (int): Global step value to record # 对应的x轴
walltime (float): Optional override default walltime (time.time())
with seconds after epoch of event
""" # demo
from torch.utils.tensorboard import SummaryWriter
writer = SummaryWriter('runs') # 实例化一个对象
for i in range(100):
writer.add_scalar("y=x^2", i**2, i) # 分别对应title y轴 x轴
writer.close()
# writer.add_image()  # 添加图片
"""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
Shape:
img_tensor: Default is :math:`(3, H, W)`. You can use ``torchvision.utils.make_grid()`` to
convert a batch of tensor into 3xHxW format or call ``add_images`` and let us do the job.
Tensor with :math:`(1, H, W)`, :math:`(H, W)`, :math:`(H, W, 3)` is also suitable as long as
corresponding ``dataformats`` argument is passed, e.g. ``CHW``, ``HWC``, ``HW``. Examples:: from torch.utils.tensorboard import SummaryWriter
import numpy as np
img = np.zeros((3, 100, 100))
img[0] = np.arange(0, 10000).reshape(100, 100) / 10000
img[1] = 1 - np.arange(0, 10000).reshape(100, 100) / 10000 img_HWC = np.zeros((100, 100, 3))
img_HWC[:, :, 0] = np.arange(0, 10000).reshape(100, 100) / 10000
img_HWC[:, :, 1] = 1 - np.arange(0, 10000).reshape(100, 100) / 10000 writer = SummaryWriter()
writer.add_image('my_image', img, 0) # If you have non-default dimension setting, set the dataformats argument.
writer.add_image('my_image_HWC', img_HWC, 0, dataformats='HWC')
writer.close() Expected result: .. image:: _static/img/tensorboard/add_image.png
:scale: 50 % """
# demo
from torch.utils.tensorboard import SummaryWriter
import cv2
write = SummaryWriter("logs")
img_array1 = cv2.imread('./dog.jpeg') # 读取图片,类型为ndarray
write.add_image("img", img_array1, 1, dataformats='HWC') # title, 数据: ndarray/tensor step 数据的类型: 默认:'CHW'
write.close()

开启面板

# 方法1: tensorboard --logdir=runs
# 方法2: tensorboard --logdir runs
# 方法3: tensorboard --logdir=runs --port=6007 如果端口冲突使用不冲突的端口

深度学习可视化工具--tensorboard的使用的更多相关文章

  1. 深度学习标注工具 LabelMe 的使用教程(Windows 版本)

    深度学习标注工具 LabelMe 的使用教程(Windows 版本) 2018-11-21 20:12:53 精灵标注助手:http://www.jinglingbiaozhu.com/ LabelM ...

  2. AI - TensorFlow - 可视化工具TensorBoard

    TensorBoard TensorFlow自带的可视化工具,能够以直观的流程图的方式,清楚展示出整个神经网络的结构和框架,便于理解模型和发现问题. 可视化学习:https://www.tensorf ...

  3. 远程连接服务器jupyter notebook、浏览器以及深度学习可视化方法

    h1 { counter-reset: h2counter; } h2 { counter-reset: h3counter; } h3 { counter-reset: h4counter; } h ...

  4. 深度学习开源工具——caffe介绍

    本页是转载caffe的一个介绍,之前的页面图都down了,更新一下. 目录 简介 要点记录 提问 总结 简介 报告时间是北京时间 12月14日 凌晨一点到两点,主讲人是 Caffe 团队的核心之一 E ...

  5. 【Tool】 深度学习常用工具

    1. caffe 网络结构可视化 http://ethereon.github.io/netscope/quickstart.html 将网络结构复制粘贴到左侧的编辑框,按Shift+Enter就可以 ...

  6. TensorFlow高级API(tf.contrib.learn)及可视化工具TensorBoard的使用

    一.TensorFlow高层次机器学习API (tf.contrib.learn) 1.tf.contrib.learn.datasets.base.load_csv_with_header 加载cs ...

  7. Linux下深度学习常用工具的安装

    .Matlab 2015 64bit 的安装 (一)安装包下载 百度网盘: [https://pan.baidu.com/s/1gf9IeCN], 密码: 4gj3 (二)Vmware 使用Windo ...

  8. 【深度学习系列】PaddlePaddle可视化之VisualDL

    上篇文章我们讲了如何对模型进行可视化,用的keras手动绘图输出CNN训练的中途结果,本篇文章将讲述如何用PaddlePaddle新开源的VisualDL来进行可视化.在讲VisualDL之前,我们先 ...

  9. 深度学习-CNN tensorflow 可视化

    tf.summary模块的简介 在TensorFlow中,最常用的可视化方法有三种途径,分别为TensorFlow与OpenCv的混合编程.利用Matpltlib进行可视化.利用TensorFlow自 ...

随机推荐

  1. 深入理解ES6之《块级作用域绑定》

    众所周知,js中的var声明存在变量提升机制,因此ESMAScript 6引用了块级作用域来强化对变量生命周期的控制let const 声明不会被提升,有几个需要注意的点1.不能被重复声明 假设作用域 ...

  2. 我试试这个昵称好使不队项目NABCD指路

    我试试这个昵称好使不队项目NABCD指路:https://www.cnblogs.com/team-development/p/14617203.html

  3. IDEA个人常用快捷键

    Ctrl+Z:撤销 Ctrl+Shift+Z:重做 Ctrl+X:剪贴 Ctrl+C:复制 Ctrl+V:粘贴 Ctrl+Y:删除当前行 Ctrl+D:复制当前行 Alt+向左箭头:返回上次光标位置 ...

  4. uView的DatetimePicker详解

    uView UI号称: 是全面兼容nvue的uni-app生态框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水 亲身感受,用起来真的坑太多, 官方文档太简洁, 很多配置都没说明也没代码, 上百度查 ...

  5. B03. BootstrapBlazor实战 10分钟编写数据库维护项目

    demo演示的是Sqlite驱动,FreeSql支持多种数据库,MySql/SqlServer/PostgreSQL/Oracle/Sqlite/Firebird/达梦/神通/人大金仓/翰高/华为Ga ...

  6. Python里的引用与拷贝规律

    python的可变不可变与各种浅拷贝深拷贝规则,一并梳理. Python一切皆引用 在C++/Java里,int a = 1就是创建变量为a,赋值为1:int b = a就是创建变量b,赋值为a的值. ...

  7. Unity制作特写镜头

    ##类似这种效果 黑边的大小可以自行调整 ###这里为了方便直接用两个Button绑定了方法,有需要自行调用方法 ##1.首先制作上下两层黑边 创建Canvas然后在canvas上新建空物体,命名为C ...

  8. Asynchronous Methods for Deep Reinforcement Learning

    郑重声明:原文参见标题,如有侵权,请联系作者,将会撤销发布! ICML 2016 Abstract 我们提出了一个概念上简单且轻量级的深度强化学习框架,该框架使用异步梯度下降来优化深度神经网络控制器. ...

  9. 2021.12.10 P5041 [HAOI2009]求回文串(树状数组求逆序对)

    2021.12.10 P5041 [HAOI2009]求回文串(树状数组求逆序对) https://www.luogu.com.cn/problem/P5041 题意: 给一个字符串 \(S\) ,每 ...

  10. 认识 vh 和 vw 单位

    1. 页面 html 结构 <header> <h1>欢迎来到米修在线</h1> <p>Lorem ipsum dolor sit amet conse ...