回答

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

相關問題