【发布时间】:2020-03-21 12:30:01
【问题描述】:
在 Tensorflow 1.x 中,有一种方法可以使用 tf.contrib.distribute.DistributeConfig 将 Estimator 连接到远程集群,正如 Tensorflow 生态系统存储库中的 this example code 所展示的那样。
Tensorflow 2.0 引入了实验性的MultiWorkerMirroredStrategy 并更改了RunConfig 的实现以使用TF_CONFIG 环境变量来设置集群。但是,这要求当前执行的代码是该集群的一部分,即task 必须在TF_CONFIG 中设置。如果您尝试将客户端计算机连接到远程集群,这当然没有意义。
有谁知道在 Tensorflow 2.0 中是否有等效的方法来实现这一点?我一直在寻找几个小时,我能想到的最好的方法是通过调用tf.compat.v1.Session('grpc://[cluster-ip]:[cluster-port]') 进行连接,然后使用v1 兼容API 进行设置。这不太理想,因为我们不仅使用已弃用的 API,而且似乎失去了跨多个工作人员分发的能力(Session 一次只能连接到一个节点)。
【问题讨论】:
标签: tensorflow keras distributed-computing tensorflow2.0 tensorflow-estimator