visdom&tensorBoardX可视化
2019-05-21 本文已影响0人
delta1037
acc,loss曲线的可视化
visdom
- 安装
$ pip install visdom
- 启用
$ python -m visdom.server
- 使用
import visdom
vis = visdom.Visdom(env='model_env')
多曲线可视化(loss,acc)
vis.line(Y=np.column_stack(np.array([train_loss, train_acc,test_acc])),
X=np.column_stack(np.array([epoch + 1, epoch + 1, epoch + 1])),
win='main',
update='append')
tensorboardX
- 安装
$ pip install tensorboardX
- 使用
from tensorboardX import SummaryWriter
writer = SummaryWriter('/path/to/log')
多曲线可视化(loss, acc)
writer.add_scalars('data/group', {'test_loss':loss_vue, 'test_acc':acc_vue}, train_step)