【问题标题】:Running distributed Tensorflow on Google Cloud ML engine ClusterSpec在 Google Cloud ML 引擎 ClusterSpec 上运行分布式 TensorFlow
【发布时间】:2017-12-08 03:23:29
【问题描述】:
我正在尝试在 Google Cloud 的 ML 引擎上运行一个大型分布式张量流模型,但无法理解 tf.train.ClusterSpec 应该发生什么。
当您在 Google Cloud 上运行作业时,您可以从 BASIC、STANDARD_1、PREMIUM_1、BASIC_GPU 或 CUSTOM 中选择scale tier,每个都可以让您访问不同类型的集群。但是,我在这些集群中找不到机器的名称/地址。
【问题讨论】:
标签:
tensorflow
tensorflow-serving
google-cloud-ml
tensorflow-gpu
google-cloud-ml-engine
【解决方案1】:
请查看文档和示例here。您应该使用环境变量 TF_CONFIG 设置 ClusterSpec;例如
tf_config = os.environ.get('TF_CONFIG')
# If TF_CONFIG is not available run local
if not tf_config:
return run('', True, *args, **kwargs)
tf_config_json = json.loads(tf_config)
cluster = tf_config_json.get('cluster')
...
cluster_spec = tf.train.ClusterSpec(cluster)