tf.keras.utils.GeneratorEnqueuer
Stay organized with collections
Save and categorize content based on your preferences.
Builds a queue out of a data generator.
Inherits From: SequenceEnqueuer
View aliases
Compat aliases for migration
See
Migration guide for
more details.
`tf.compat.v1.keras.utils.GeneratorEnqueuer`
tf.keras.utils.GeneratorEnqueuer(
generator, use_multiprocessing=False, random_seed=None
)
The provided generator can be finite in which case the class will throw
a StopIteration
exception.
Args |
generator
|
a generator function which yields data
|
use_multiprocessing
|
use multiprocessing if True, otherwise threading
|
random_seed
|
Initial seed for workers,
will be incremented by one for each worker.
|
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.
[[["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 2023-10-06 UTC."],[],[]]