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. 判断页面环境是否在小程序的webview中

    最近公司需要做小程序项目,但是又希望能够快速开发,就想着把web端的响应式页面放到webview里快速开发.但在判断页面环境的时候出现一些问题. 环境问题 用小程序提供的wx.miniProgram. ...

  2. Taro时间选择器+地址选择器

    时间地址选择器 https://www.manzj.net/topic/5c3c2123cd01b8af5bce4373

  3. 看完这篇文章你就可以告诉领导你精通Zookeeper了

    一.Zookeeper概述 1.概述 Zookeeper 是一个开源的为分布式框架提供协调服务的 Apache 项目.在分布式系统中,扮演注册中心的角色. Zookeeper数据模型的结构与Linux ...

  4. C++篇:第八章_类_知识点大全

    C++篇为本人学C++时所做笔记(特别是疑难杂点),全是硬货,虽然看着枯燥但会让你收益颇丰,可用作学习C++的一大利器 八.类 (一)类的概念与规则 "子类"和"子类型& ...

  5. python爬虫---字体反爬

    目标地址:http://glidedsky.com/level/web/crawler-font-puzzle-1 打开google调试工具检查发现网页上和源码之中的数字不一样, 已经确认该题目为 字 ...

  6. 快速排序算法 - go实现

    在分析redis集群中大Key的时候,通常都采用分析rdb文件的方式:但是这种方式需要在每一台redis服务器上部署分析程序及分析脚本,而像salt之类的工具运维没有开放给我们使用,一台一台部署不好管 ...

  7. 读完学会shell语法,shell脚本80%已经学会

    第3章 shell语法讲解 3.1 shell运算讲解 3.1.1 运算符的讲解 3.1.2 shell运算方式的讲解 3.1.2.1 $(())运算 [root@m01 test_init] # a ...

  8. Python打印表格

    使用Python在终端打印表格 import prettytable table = PrettyTable(['Title1', 'Title2', 'Title3']) table.add_row ...

  9. TF-IDF笔记(直接调用函数、手写)

    首先TF-IDF 全称:term frequency–inverse document frequency,是一种用于信息检索与数据挖掘的常用加权技术. TF是词频(Term Frequency),I ...

  10. DDT数据驱动性能测试(一)

    DDT数据驱动性能测试(一) 一.csv数据文件设置 1.使用场景:测试过程中需要使用手机号码等大量数据时,用random函数随机生成数字:也可以使用Excel拖动生成一批手机号,也有可以从数据库中导 ...