tf.keras.utils.OrderedEnqueuer
Stay organized with collections
Save and categorize content based on your preferences.
Builds a Enqueuer from a Sequence.
Inherits From: SequenceEnqueuer
View aliases
Compat aliases for migration
See
Migration guide for
more details.
`tf.compat.v1.keras.utils.OrderedEnqueuer`
tf.keras.utils.OrderedEnqueuer(
sequence, use_multiprocessing=False, shuffle=False
)
Args |
sequence
|
A tf.keras.utils.data_utils.Sequence object.
|
use_multiprocessing
|
use multiprocessing if True, otherwise threading
|
shuffle
|
whether to shuffle the data at the beginning of each epoch
|
Methods
get
View source
get()
Creates a generator to extract data from the queue.
Skip the data if it is None
.
Yields |
The next element in the queue, i.e. a tuple
(inputs, targets) or
(inputs, targets, sample_weights) .
|
is_running
View source
is_running()
start
View source
start(
workers=1, max_queue_size=10
)
Starts the handler's workers.
Args |
workers
|
Number of workers.
|
max_queue_size
|
queue size
(when full, workers could block on put() )
|
stop
View source
stop(
timeout=None
)
Stops running threads and wait for them to exit, if necessary.
Should be called by the same thread which called start()
.
Args |
timeout
|
maximum time to wait on thread.join()
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[],[],null,["# tf.keras.utils.OrderedEnqueuer\n\n\u003cbr /\u003e\n\n|--------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/keras-team/keras/tree/v2.9.0/keras/utils/data_utils.py#L712-L799) |\n\nBuilds a Enqueuer from a Sequence.\n\nInherits From: [`SequenceEnqueuer`](../../../tf/keras/utils/SequenceEnqueuer)\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.keras.utils.OrderedEnqueuer\\`\n\n\u003cbr /\u003e\n\n tf.keras.utils.OrderedEnqueuer(\n sequence, use_multiprocessing=False, shuffle=False\n )\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-----------------------|------------------------------------------------------------|\n| `sequence` | A `tf.keras.utils.data_utils.Sequence` object. |\n| `use_multiprocessing` | use multiprocessing if True, otherwise threading |\n| `shuffle` | whether to shuffle the data at the beginning of each epoch |\n\n\u003cbr /\u003e\n\nMethods\n-------\n\n### `get`\n\n[View source](https://github.com/keras-team/keras/tree/v2.9.0/keras/utils/data_utils.py#L778-L799) \n\n get()\n\nCreates a generator to extract data from the queue.\n\nSkip the data if it is `None`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Yields ||\n|---|---|\n| The next element in the queue, i.e. a tuple `(inputs, targets)` or `(inputs, targets, sample_weights)`. ||\n\n\u003cbr /\u003e\n\n### `is_running`\n\n[View source](https://github.com/keras-team/keras/tree/v2.9.0/keras/utils/data_utils.py#L635-L636) \n\n is_running()\n\n### `start`\n\n[View source](https://github.com/keras-team/keras/tree/v2.9.0/keras/utils/data_utils.py#L638-L656) \n\n start(\n workers=1, max_queue_size=10\n )\n\nStarts the handler's workers.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|------------------|--------------------------------------------------------|\n| `workers` | Number of workers. |\n| `max_queue_size` | queue size (when full, workers could block on `put()`) |\n\n\u003cbr /\u003e\n\n### `stop`\n\n[View source](https://github.com/keras-team/keras/tree/v2.9.0/keras/utils/data_utils.py#L663-L677) \n\n stop(\n timeout=None\n )\n\nStops running threads and wait for them to exit, if necessary.\n\nShould be called by the same thread which called `start()`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|-----------|-----------------------------------------|\n| `timeout` | maximum time to wait on `thread.join()` |\n\n\u003cbr /\u003e"]]