aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/training/monitored_session.py
diff options
context:
space:
mode:
authorGravatar Derek Murray <mrry@google.com>2018-08-30 17:36:05 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-08-30 17:39:38 -0700
commit90ee746add3917daeba3e3b6fb4fe41ddc5a4ea8 (patch)
treedb0071f7fe91a8fe147e0bd8936fde5558dce079 /tensorflow/python/training/monitored_session.py
parent0278712da34922ec9fd5e2a4484b3b3243f7784c (diff)
Add a warning when `tf.train.start_queue_runners()` is called with no queue runners defined.
This complements the deprecation warning that is printed when that function is called, and provides an actionable hint that the user can delete the call. PiperOrigin-RevId: 211012334
Diffstat (limited to 'tensorflow/python/training/monitored_session.py')
-rw-r--r--tensorflow/python/training/monitored_session.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tensorflow/python/training/monitored_session.py b/tensorflow/python/training/monitored_session.py
index 8dcc1666e0..0e0125a956 100644
--- a/tensorflow/python/training/monitored_session.py
+++ b/tensorflow/python/training/monitored_session.py
@@ -800,7 +800,8 @@ class _MonitoredSession(object):
self.tf_sess = self._session_creator.create_session()
# We don't want coordinator to suppress any exception.
self.coord = coordinator.Coordinator(clean_stop_exception_types=[])
- queue_runner.start_queue_runners(sess=self.tf_sess, coord=self.coord)
+ if ops.get_collection(ops.GraphKeys.QUEUE_RUNNERS):
+ queue_runner.start_queue_runners(sess=self.tf_sess, coord=self.coord)
# Inform the hooks that a new session has been created.
for hook in self._hooks:
hook.after_create_session(self.tf_sess, self.coord)