QueueRunners are not compatible with eager execution. Instead, please
use tf.data to get data into your
model.
Description
When building a complex model that uses many queues it is often difficult to
gather all the queue runners that need to be run. This convenience function
allows you to add a queue runner to a well known collection in the graph.
The companion method start_queue_runners() can be used to start threads for
all the collected queue runners.
Args
qr
A QueueRunner.
collection
A GraphKey specifying the graph collection to add
the queue runner to. Defaults to GraphKeys.QUEUE_RUNNERS.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[],null,["# tf.compat.v1.train.add_queue_runner\n\n\u003cbr /\u003e\n\n|------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.16.1/tensorflow/python/training/queue_runner_impl.py#L391-L414) |\n\nAdds a `QueueRunner` to a collection in the graph. (deprecated)\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.train.queue_runner.add_queue_runner`](https://www.tensorflow.org/api_docs/python/tf/compat/v1/train/add_queue_runner)\n\n\u003cbr /\u003e\n\n tf.compat.v1.train.add_queue_runner(\n qr, collection=ops.GraphKeys.QUEUE_RUNNERS\n )\n\n\u003cbr /\u003e\n\nMigrate to TF2\n--------------\n\n\u003cbr /\u003e\n\n| **Caution:** This API was designed for TensorFlow v1. Continue reading for details on how to migrate from this API to a native TensorFlow v2 equivalent. See the [TensorFlow v1 to TensorFlow v2 migration guide](https://www.tensorflow.org/guide/migrate) for instructions on how to migrate the rest of your code.\n\nQueueRunners are not compatible with eager execution. Instead, please\nuse [tf.data](https://www.tensorflow.org/guide/data) to get data into your\nmodel.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nDescription\n-----------\n\n| **Deprecated:** THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: To construct input pipelines, use the [`tf.data`](../../../../tf/data) module.\n\nWhen building a complex model that uses many queues it is often difficult to\ngather all the queue runners that need to be run. This convenience function\nallows you to add a queue runner to a well known collection in the graph.\n\nThe companion method `start_queue_runners()` can be used to start threads for\nall the collected queue runners.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|--------------|-----------------------------------------------------------------------------------------------------------------|\n| `qr` | A `QueueRunner`. |\n| `collection` | A `GraphKey` specifying the graph collection to add the queue runner to. Defaults to `GraphKeys.QUEUE_RUNNERS`. |\n\n\u003cbr /\u003e"]]