回答

0

请查看文档和示例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) 
+0

谢谢,这正是我一直在寻找的。 – Miguel

相关问题