ML Community Day is November 9! Join us for updates from TensorFlow, JAX, and more Learn more


TensorFlow 1 version View source on GitHub

Builds a queue out of a data generator.

Inherits From: SequenceEnqueuer

The provided generator can be finite in which case the class will throw a StopIteration exception.

Used in fit_generator, evaluate_generator, predict_generator.

generator a generator function which yields data
use_multiprocessing use multiprocessing if True, otherwise threading
wait_time time to sleep in-between calls to put()
random_seed Initial seed for workers, will be incremented by one for each worker.



View source

Creates a generator to extract data from the queue.

Skip the data if it is None.


The next element in the queue, i.e. a tuple (inputs, targets) or (inputs, targets, sample_weights).


View source


View source

Starts the handler's workers.

workers Number of workers.
max_queue_size queue size (when full, workers could block on put())


View source

Stops running threads and wait for them to exit, if necessary.

Should be called by the same thread which called start().

timeout maximum time to wait on thread.join()