Algorithm Tensorflow如何转储结果放置算法
我对模型并行性很感兴趣,我已经从中阅读了代码。在那个例子中,我们应该将我们的模型(或者在tensorflow中我们称之为Graph)手动划分为不同的分区(left_网络和right_网络)。 所以,我想知道如果我必须手动进行分区,Algorithm Tensorflow如何转储结果放置算法,algorithm,tensorflow,Algorithm,Tensorflow,我对模型并行性很感兴趣,我已经从中阅读了代码。在那个例子中,我们应该将我们的模型(或者在tensorflow中我们称之为Graph)手动划分为不同的分区(left_网络和right_网络)。 所以,我想知道如果我必须手动进行分区,simple\u placer.cc和graph\u partition.cc对整个图形做了什么?我还是不太清楚 在我看来(如果有什么不对劲,请告诉我): 如果图中有8个分区(子图),可以看作是8个作业和4个辅助对象,那么如何通过以下方式将分区分配给辅助对象: 通过t
simple\u placer.cc
和graph\u partition.cc
对整个图形做了什么?我还是不太清楚
- 通过
进行显式注释,或tf.device()
- 分布式训练,
在参数服务器之间共享变量,否则将所有 工作设备上的操作tf.train.replica\u device\u setter()
matmul
是一个op节点吗,它会被划分成
不同的工作
y_ = tf.placeholder(tf.float32, [None, 10])
x = tf.placeholder(tf.float32, [None, 784])
W = tf.Variable(tf.zeros([784, 10]))
b = tf.Variable(tf.zeros([10]))
y = tf.matmul(x, W) + b
调用
tf.Session.run()
非常有用的代码片段。我仍然在想,在插入发送/接收操作后,是否有办法将图形转储为PB?
# ...
y = tf.matmul(x, W) + b
sess = tf.Session()
options = tf.RunOptions(output_partition_graphs=True)
metadata = tf.RunMetadata()
sess.run(y, options=options, run_metadata=metadata)
# `metadata` now contains information about what happened during the `run()` call.
for partition in metadata.partition_graphs:
# `partition` is a `tf.GraphDef` representing all the nodes that ran on a single
# device. All nodes in `partition` have the same `device` value.
device = partition.node[0].device
for node in partition.node:
# e.g. print each node or store it in a dictionary for further analysis.
# ...