Tensorflow documentationは、ノードのデバイスの配置を見つける上で次のコード例を持っているものをプリントアウトしません。すなわち、どの装置で特定の計算が行われるかである。Tensorflowドキュメントのサンプルコードは、
# Creates a graph.
a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')
b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')
c = tf.matmul(a, b)
# Creates a session with log_device_placement set to True.
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
# Runs the op.
print sess.run(c)
私の場合、コードは想定されているようにデバイスの場所を表示しません。私はUbuntuで動作するJupyterノートブックを使用しています。私はこれを修正したり、情報を他の方法で見つけることができますか?
'' '' –
guillefix
は単に 'print metadata.partition_graphs'の代わりに' print metadata'を使います。あなたはオブジェクトのセットを見るでしょう。それぞれを 'print metadata.partition_graphs [0]'のようにインデックスで見ることができます。 –