Pytorch visdom error:AttributeError: 'Visdom' object has no attribute 'updateTrace'

Pytorch visdom error:AttributeError: ‘Visdom’ object has no attribute 'updateTrace’

如果想在同一个图中画多个曲线,原来的API updateTrace已经废弃了,可以直接在line等API加上**update=”append”**即可

代码示例

vis2 = visdom.Visdom(env='test2')
for ii in range(0,10):
    x = torch.Tensor([ii])
    y = x

    vis2.line(X=x,Y=y,win='polynomial',update='append' if ii>0 else None)
x = torch.arange(0,9,0.1)
y = (x ** 2)/9
vis2.line(X=x,Y=y,win='polynomial',name = 'this is new trace',update='append')

你可能感兴趣的:(pytorch学习)