感谢: https://blog.csdn.net/lxx516/article/details/79019328
命令行开启服务:python -m visdom.server
本地浏览器链接visdom:将上述localhost更改为远程服务器的ip地址即可,10.000.000.000:8097 (10.000.000.000为远程服务器ip地址)
代码部分(以三条曲线为例):
import:
from visdom import Visdom
初始化:
viz = Visdom(env='LFN_train_Loss')
train_loss_x,train_loss_y=0,0
win1 = viz.line(X=np.array([train_loss_x]),Y=np.array([train_loss_y]),opts=dict(title='train_Loss'))
viz = Visdom(env='LFN_train_Acc')
train_acc_x,train_acc_y=0,0
win2 = viz.line(X=np.array([train_acc_x]),Y=np.array([train_acc_y]),opts=dict(title='train_Loss'))
viz = Visdom(env='LFN_test_Acc')
test_acc_x,test_acc_y=0,0
win3 = viz.line(X=np.array([test_acc_x]),Y=np.array([test_acc_y]),opts=dict(title='test_Acc'))
每个epoch更新:
viz.line(X=np.array([epoch]),Y=np.array([loss]),win=win1,update='append')
viz.line(X=np.array([epoch]),Y=np.array([top1]),win=win2,update='append')
viz.line(X=np.array([epoch]),Y=np.array([top1]),win=win3,update='append')
效果: