How to combine not all reports in a tensor flow?

I have a large graph with two parts, I start in turn. Both have bulletins.

I called up a resume with node

merged_summary = tf.summary.merge_all()

but noticed that he calls tensors in the second half of the graph, estimated before he makes sense.

So, how to combine only a summary of one half of my schedule?

+4
source share
2 answers

assuming you have two lists of summaries of the first and second graphs, i.e.

summaries_first = [tf.summary.image("my_first_graph_input", image), ...]
summary_second = [tf.summary.scalar("my_second_graph_loss"), ..]

combine each list into one op total:

first_graph_summary_op = tf.summary.merge(summaries_first)
second_graph_summary_op = tf.summary.merge(summary_second)

Now, whenever you execute sess.run()on each graph, evaluate its corresponding summary operator op and write it down.

+5
source

, tf.summary.merge, , . , :

cost_summary = tf.summary.scalar('cost_sum', cost)  # for some 'cost' tensor
grad_summary = tf.summary.scalar('grad_sum', grad)  # for some 'grad' tensor

merged = tf.summary.merge([cost_summary, grad_summary])
+4

Source: https://habr.com/ru/post/1687178/


All Articles