TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

tf.contrib.distribute.run_standard_tensorflow_server

View source on GitHub

Starts a standard TensorFlow server.

tf.contrib.distribute.run_standard_tensorflow_server(session_config=None)

This method parses configurations from "TF_CONFIG" environment variable and starts a TensorFlow server. The "TF_CONFIG" is typically a json string and must have information of the cluster and the role of the server in the cluster. One example is:

TF_CONFIG='{ "cluster": { "worker": ["host1:2222", "host2:2222", "host3:2222"], "ps": ["host4:2222", "host5:2222"] }, "task": {"type": "worker", "index": 1} }'

This "TF_CONFIG" specifies there are 3 workers and 2 ps tasks in the cluster and the current role is worker 1.

Valid task types are "chief", "worker", "ps" and "evaluator" and you can have at most one "chief" and at most one "evaluator".

An optional key-value can be specified is "rpc_layer". The default value is "grpc".

Args:

  • session_config: an optional tf.compat.v1.ConfigProto object. Users can pass in the session config object to configure server-local devices.

Returns:

a tf.distribute.Server object which has already been started.

Raises:

  • ValueError: if the "TF_CONFIG" environment is not complete.