Tensorflow 特定分支机构的汇总表

Tensorflow 特定分支机构的汇总表,tensorflow,tensorboard,Tensorflow,Tensorboard,我有一个tensorflow图,它有一个用于训练的复杂损失函数,但用于评估的更简单(它们共享祖先)。本质上 train_op = ... (needs more things in feed_dict etc.) acc = .... (just needs one value for placeholer) 为了更好地理解发生了什么,我添加了摘要。但是打电话 merged = tf.summary.merge_all() 然后 (summ, acc) = session.run([merg

我有一个tensorflow图,它有一个用于训练的复杂损失函数,但用于评估的更简单(它们共享祖先)。本质上

train_op = ... (needs more things in feed_dict etc.)
acc = .... (just needs one value for placeholer)
为了更好地理解发生了什么,我添加了摘要。但是打电话

merged = tf.summary.merge_all()
然后

(summ, acc) = session.run([merged, acc_eval], feed_dict={..})

tensorflow抱怨占位符的值丢失。

据我所知,要总结特定的tensorflow操作,您应该专门运行它

例如:

# define accuracy ops
correct_prediction = tf.equal(tf.argmax(Y, axis=1), tf.argmax(Y_labels, axis=1))  
accuracy = tf.reduce_mean(tf.cast(correct_prediction, dtype=tf.float32))  

# summary_accuracy is the Summary protocol buffer you need to run, 
# instead of merge_all(), if you want to summary specific ops
summary_accuracy = tf.summary.scalar('testing_accuracy', accuracy) 

# define writer file
sess.run(tf.global_variables_initializer())
test_writer = tf.summary.FileWriter('log/test', sess.graph)

(summ, acc) = sess.run([summary_accuracy, accuracy], feed_dict={..})
test_writer.add_summary(summ)
此外,您还可以使用
tf.summary.merge()
,。
希望这有帮助