Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Device placement unknown in Tensorboard

I'd like to investigate device placement in the tensorboard using the following code for generating the graph in the summary

# Build the summary operation based on the TF collection of Summaries.
summary_op = tf.merge_all_summaries()
saver = tf.train.Saver(tf.all_variables())
summary_writer = tf.train.SummaryWriter(log_directory, graph_def=sess.graph_def)

This works for displaying the graph and summaries defined in the graph. But when selecting 'device placement' in the tensorboard, all nodes are assigned to 'unknown device'. Do I need to dump the device placement in some other way?

like image 834
panmari Avatar asked Nov 27 '15 10:11

panmari


1 Answers

The TensorBoard graph visualizer only sees the explicit device assignments that you have made in your program (i.e. those made using with tf.Device("..."): blocks).

The reason for this is that the nodes in a TensorFlow graph are assigned to devices in multiple stages. The first stage, in the client (e.g. your Python program) allows you to explicitly—and optionally—assign devices to each node, and it is the output of this stage that is written to the TensorBoard logs. A later placement stage runs inside the TensorFlow backend, and assigns every node to a device.

I suspect you want to analyze the results of the later placement stage. Currently there is no support for this in TensorBoard, but you can extract some information by creating the tf.Session as follows:

sess = tf.Session(config=tf.ConfigProto(
    log_device_placement=True))

…and then the device placement decisions will be logged to stderr.

like image 72
mrry Avatar answered Oct 20 '22 17:10

mrry