我只看到当前驻留在符号张量(logits、label)中的图像:
with tf.name_scope("Train"):
optimizer = tf.train.AdamOptimizer(FLAGS.learning_rate).minimize(cost_function)
tf.summary.image('logits', tn_logits, max_outputs=4)
tf.summary.image('label', t_label, max_outputs=4)
在 session 中,我循环提供网络图像。
for epoch in range(FLAGS.training_epochs):
for img in images:
_, summary_str, costs = sess.run([optimizer, merged_summary_op, cost_function],
feed_dict={t_im0: img.l_img.eval(), t_im1: img.r_img.eval(),
t_label: img.mask.eval()})
如何同时显示所有图像?
我想像画廊一样为我的所有图像提供这个 View :
最佳答案
图像张量的第一维和 max_output
tf.summary.image
的论据定义张量板图库中的图像数量。由于您一次写入 1 个图像,因此现有图像将被覆盖。
而不是迭代,连接 4 个图像,使得 tn_logits
和 t_label
将具有 [4, h, w, 1]
的形状.
然后在张量板中你将有 Train/logits/image/0
, Train/label/image/1
, Train/label/image/2
和 Train/label/image/3
tn_logits
的条目.
关于tensorflow - 如何在张量板中显示我的所有图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45584557/