MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / start_queue_runners

Method start_queue_runners

tensorflow/python/training/supervisor.py:747–780  ·  view source on GitHub ↗

Start threads for `QueueRunners`. Note that the queue runners collected in the graph key `QUEUE_RUNNERS` are already started automatically when you create a session with the supervisor, so unless you have non-collected queue runners to start you do not need to call this explicitly.

(self, sess, queue_runners=None)

Source from the content-addressed store, hash-verified

745 return sess
746
747 def start_queue_runners(self, sess, queue_runners=None):
748 """Start threads for `QueueRunners`.
749
750 Note that the queue runners collected in the graph key `QUEUE_RUNNERS`
751 are already started automatically when you create a session with the
752 supervisor, so unless you have non-collected queue runners to start
753 you do not need to call this explicitly.
754
755 Args:
756 sess: A `Session`.
757 queue_runners: A list of `QueueRunners`. If not specified, we'll use the
758 list of queue runners gathered in the graph under the key
759 `GraphKeys.QUEUE_RUNNERS`.
760
761 Returns:
762 The list of threads started for the `QueueRunners`.
763
764 Raises:
765 RuntimeError: If called with eager execution enabled.
766
767 @compatibility(eager)
768 Queues are not compatible with eager execution. To ingest data when eager
769 execution is enabled, use the `tf.data` API.
770 @end_compatibility
771 """
772 if context.executing_eagerly():
773 raise RuntimeError("Queues are not compatible with eager execution.")
774 if queue_runners is None:
775 queue_runners = self._graph.get_collection(ops.GraphKeys.QUEUE_RUNNERS)
776 threads = []
777 for qr in queue_runners:
778 threads.extend(
779 qr.create_threads(sess, coord=self._coord, daemon=True, start=True))
780 return threads
781
782 def loop(self, timer_interval_secs, target, args=None, kwargs=None):
783 """Start a LooperThread that calls a function periodically.

Callers 15

trainFunction · 0.95
testTFRecordReaderMethod · 0.95
testNoQueueRunnersMethod · 0.95
mainFunction · 0.45
testReadFromSameFileMethod · 0.45
test_simpleMethod · 0.45
test_shuffleMethod · 0.45
test_slicesMethod · 0.45

Calls 4

executing_eagerlyMethod · 0.80
create_threadsMethod · 0.80
get_collectionMethod · 0.45
extendMethod · 0.45

Tested by 15

testTFRecordReaderMethod · 0.76
testNoQueueRunnersMethod · 0.76
testReadFromSameFileMethod · 0.36
test_simpleMethod · 0.36
test_shuffleMethod · 0.36
test_slicesMethod · 0.36
test_simple_datasetMethod · 0.36
testNoShuffleMethod · 0.36
testNoShapeInferenceMethod · 0.36