没有得到" Scalar"虽然代码已实现,但Tensorboard中的仪表板

时间:2017-04-09 08:49:38

标签: tensorflow tensorboard

我没有得到" Scalar"正如我在演练视频中看到的那样,在Tensorboard仪表板中进行了标题,尽管我已经根据需要实现了所需的代码。

我使用的相关代码是:

# cost and accuracy
with tf.name_scope("xent"):
    cross_entropy = tf.nn.softmax_cross_entropy_with_logits(logits=fc3l[0], labels=y)
    tf.scalar_summary('cross_entropy', cross_entropy)

with tf.name_scope("train"):
    train_step = tf.train.AdamOptimizer(lr).minimize(cross_entropy)

with tf.name_scope("accuracy"):
    correct_prediction = tf.equal(tf.argmax(probs, 1), tf.argmax(y, 0))
    accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
    tf.scalar_summary('accuracy', accuracy)

# init
sess = tf.Session()
merged_summary = tf.merge_all_summaries()
writer = tf.train.SummaryWriter("/tmp/tfvgg/1", sess.graph)
init = tf.initialize_all_variables()
sess.run(init)

我使用Tensorflow版本0.11.0,我在Tensorboard中获得的标题是:"事件","图像","音频&# 34;," Graphs"," Distributions"," Histograms",但不是" Scalars"。

据我所知,TF I使用的版本不支持tf.summary.merge_all()tf.summary.scalar()等实现。

1 个答案:

答案 0 :(得分:0)

For future reference, after updating Tensorflow to version 1.0 I used the updated calls (tf.summary.merge_all(), tf.summary.scalar()) instead which have allowed for the Scalar heading in Tensorboard