visdom模块

@TOC

visdom是一个数据可视化工具,可以让实验文本或图像可视化

github地址:https://github.com/fossasia/visdom

一、安装与启动

visdom安装

1
2
3
4
5
6
7
8
# Install Python server and client from pip 
# (STABLE VERSION, NOT ALL CURRENT FEATURES ARE SUPPORTED)
pip install visdom

# Install visdom from source
pip install -e .
# If the above runs into issues, you can try the below
easy_install .

visdom启动

运行以下命令,然后再浏览器输入http://localhost:8097即可

python -m visdom.server # 默认端口为8097
python -m visdom.server -p 端口号

二、简单示例

1. 演示文本

1
2
3
4
5
6
7
import visdom

viz = visdom.Visdom(env="Test1") # 创建环境名为Test1
textwindow = viz.text('Hello World!')
updatetextwindow = viz.text('Hello World! More text should be here')
assert updatetextwindow is not None, 'Window was none'
viz.text('And here it is', win=updatetextwindow, append=True)

运行上述程序,在http://localhost:8097的Test1环境中我们可以发现文本已经输出

Error: API rate limit exceeded for 54.225.237.72. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)