aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/learn
diff options
context:
space:
mode:
authorGravatar Li Liangbin <lilb.edwin@gmail.com>2018-07-06 21:44:00 +0800
committerGravatar Li Liangbin <lilb.edwin@gmail.com>2018-07-14 01:55:26 +0000
commit04c2ea507fc3135667d2b933df8ee4832c0f9593 (patch)
treecb8baddf01a9b4ca33725508235e501a692350f7 /tensorflow/contrib/learn
parent4424e3270e4056ef7318fbdd83727cb93bec6858 (diff)
Make protocol used in estimator customizable.
Example code as follow: config = tf.estimator.RunConfig(protocol='grpc+verbs') nn = tf.estimator.Estimator(model_fn=model_fn, model_dir=model_dir, params=params, config=config)
Diffstat (limited to 'tensorflow/contrib/learn')
-rw-r--r--tensorflow/contrib/learn/python/learn/estimators/run_config.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tensorflow/contrib/learn/python/learn/estimators/run_config.py b/tensorflow/contrib/learn/python/learn/estimators/run_config.py
index 14ee2ba609..7cb87619d9 100644
--- a/tensorflow/contrib/learn/python/learn/estimators/run_config.py
+++ b/tensorflow/contrib/learn/python/learn/estimators/run_config.py
@@ -240,6 +240,7 @@ class RunConfig(ClusterConfig, core_run_config.RunConfig):
keep_checkpoint_max=5,
keep_checkpoint_every_n_hours=10000,
log_step_count_steps=100,
+ protocol=None,
evaluation_master='',
model_dir=None,
session_config=None):
@@ -289,6 +290,8 @@ class RunConfig(ClusterConfig, core_run_config.RunConfig):
session_config: a ConfigProto used to set session parameters, or None.
Note - using this argument, it is easy to provide settings which break
otherwise perfectly good models. Use with care.
+ protocol: An optional argument which specifies the protocol used when
+ starting server. None means default to grpc.
"""
# Neither parent class calls super().__init__(), so here we have to
# manually call their __init__() methods.
@@ -313,6 +316,7 @@ class RunConfig(ClusterConfig, core_run_config.RunConfig):
self._save_summary_steps = save_summary_steps
self._save_checkpoints_secs = save_checkpoints_secs
self._log_step_count_steps = log_step_count_steps
+ self._protocol = protocol
self._session_config = session_config
if save_checkpoints_secs == RunConfig._USE_DEFAULT:
if save_checkpoints_steps is None: