Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display per-node memory in TensorBoard?

In another question, someone showed a screenshot of his TensorBoard, displaying memory usage per node:

enter image description here

I never see those in my experiments with Tensorboard. All I'm doing is calling

writer = tf.summary.FileWriter('/tmp/tensorboard', sess.graph)

after sess.run(). Are there perhaps some "summaries" that I need to add to record memory usage?

like image 777
MWB Avatar asked Oct 30 '22 07:10

MWB


2 Answers

Following the instruction here, you might actually have written all necessarry lines for memory and time to be displayed, but you also need to change the "Sessions runs" drop-down in the tensorboard GUI from default "None" to any of the options. Otherwise they are hidden. See graphic:

enter image description here

At least, this is what I needed to do to display them - the previous answers worked for me, but I needed to change the drop-down.

like image 114
NeStack Avatar answered Nov 15 '22 13:11

NeStack


You need to add some RunOptions to your session run to your summary as explained in this document (Runtime statistics section).

Here is the piece of code which allows to do this:

merged = tf.summary.merge_all()
run_options = tf.RunOptions(trace_level=tf.RunOptions.FULL_TRACE)
run_metadata = tf.RunMetadata()
summary, _ = sess.run([merged, train_step],
                              feed_dict=...,
                              options=run_options,
                              run_metadata=run_metadata)
writer.add_run_metadata(run_metadata, 'step%d' % i)
writer.add_summary(summary, i)
like image 40
pfm Avatar answered Nov 15 '22 12:11

pfm