使用Tensorboard在一个图中绘制多个图形 [英] Plot multiple graphs in one plot using 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屋!