使用Tensorboard在一个图中绘制多个图形 [英] Plot multiple graphs in one plot using Tensorboard

查看:663
本文介绍了使用Tensorboard在一个图中绘制多个图形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Tensorflow后端上使用Keras.我的工作涉及比较我的数据集上几个模型(如Inception,VGG,Resnet等)的性能. 我想在一张图中绘制几种模型的训练精度.我正在尝试在Tensorboard中执行此操作,但是它不起作用.

I am using Keras with Tensorflow backend. My work involves comparing the performances of several models such as Inception, VGG, Resnet etc on my dataset. I would like to plot the training accuracies of several models in one graph. I am trying to do this in Tensorboard, but it is not working.

是否可以使用Tensorboard在一个图中绘制多个图形,或者还有其他方法可以做到这一点?

Is there a way of plotting multiple graphs in one plot using Tensorboard or is there some other way I can do this?

谢谢

推荐答案

如果您使用的是 add_scalars :

If you are using the SummaryWriter from tensorboardX or pytorch 1.2, you have a method called add_scalars:

这样称呼:

my_summary_writer.add_scalars(f'loss/check_info', {
    'score': score[iteration],
    'score_nf': score_nf[iteration],
}, iteration)

它将显示如下:

请注意,add_scalars会干扰您的运行组织:它将在此列表中添加多个条目(从而造成混乱):

Be careful that add_scalars will mess with the organisation of your runs: it will add mutliple entries to this list (and thus create confusion):

我建议您改为:

my_summary_writer.add_scalar(f'check_info/score',    score[iter],    iter)
my_summary_writer.add_scalar(f'check_info/score_nf', score_nf[iter], iter)

这篇关于使用Tensorboard在一个图中绘制多个图形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆