Given file pattern (or list of files), will setup a queue for file names,
read Example proto using provided reader, use batch queue to create
batches of examples of size batch_size and parse example given features
specification.
All queue runners are added to the queue runners collection, and may be
started via start_queue_runners.
All ops are added to the default graph.
Args
file_pattern
List of files or patterns of file paths containing
Example records. See tf.io.gfile.glob for pattern rules.
batch_size
An int or scalar Tensor specifying the batch size to use.
features
A dict mapping feature keys to FixedLenFeature or
VarLenFeature values.
reader
A function or class that returns an object with
read method, (filename tensor) -> (example tensor).
randomize_input
Whether the input should be randomized.
num_epochs
Integer specifying the number of times to read through the
dataset. If None, cycles through the dataset forever. NOTE - If specified,
creates a variable that must be initialized, so call
tf.compat.v1.local_variables_initializer() and run the op in a session.
queue_capacity
Capacity for input queue.
feature_queue_capacity
Capacity of the parsed features queue. Set this
value to a small number, for example 5 if the parsed features are large.
reader_num_threads
The number of threads to read examples. In order to have
predictable and repeatable order of reading and enqueueing, such as in
prediction and evaluation mode, reader_num_threads should be 1.
num_enqueue_threads
Number of threads to enqueue the parsed example queue.
Using multiple threads to enqueue the parsed example queue helps maintain
a full queue when the subsequent computations overall are cheaper than
parsing. In order to have predictable and repeatable order of reading and
enqueueing, such as in prediction and evaluation mode,
num_enqueue_threads should be 1.
parse_fn
Parsing function, takes Example Tensor returns parsed
representation. If None, no parsing is done.
name
Name of resulting op.
read_batch_size
An int or scalar Tensor specifying the number of
records to read at once. If None, defaults to batch_size.
Returns
A dict of Tensor or SparseTensor objects for each in features.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.contrib.learn.read_batch_features\n\n\u003cbr /\u003e\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/learn/python/learn/learn_io/graph_io.py#L757-L834) |\n\nAdds operations to read, queue, batch and parse `Example` protos. (deprecated) \n\n tf.contrib.learn.read_batch_features(\n file_pattern, batch_size, features, reader, randomize_input=True,\n num_epochs=None, queue_capacity=10000, feature_queue_capacity=100,\n reader_num_threads=1, num_enqueue_threads=2, parse_fn=None, name=None,\n read_batch_size=None\n )\n\n| **Warning:** THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Use tf.data.\n\nGiven file pattern (or list of files), will setup a queue for file names,\nread `Example` proto using provided `reader`, use batch queue to create\nbatches of examples of size `batch_size` and parse example given `features`\nspecification.\n\nAll queue runners are added to the queue runners collection, and may be\nstarted via `start_queue_runners`.\n\nAll ops are added to the default graph.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|--------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `file_pattern` | List of files or patterns of file paths containing `Example` records. See [`tf.io.gfile.glob`](../../../tf/io/gfile/glob) for pattern rules. |\n| `batch_size` | An int or scalar `Tensor` specifying the batch size to use. |\n| `features` | A `dict` mapping feature keys to `FixedLenFeature` or `VarLenFeature` values. |\n| `reader` | A function or class that returns an object with `read` method, (filename tensor) -\\\u003e (example tensor). |\n| `randomize_input` | Whether the input should be randomized. |\n| `num_epochs` | Integer specifying the number of times to read through the dataset. If None, cycles through the dataset forever. NOTE - If specified, creates a variable that must be initialized, so call tf.compat.v1.local_variables_initializer() and run the op in a session. |\n| `queue_capacity` | Capacity for input queue. |\n| `feature_queue_capacity` | Capacity of the parsed features queue. Set this value to a small number, for example 5 if the parsed features are large. |\n| `reader_num_threads` | The number of threads to read examples. In order to have predictable and repeatable order of reading and enqueueing, such as in prediction and evaluation mode, `reader_num_threads` should be 1. |\n| `num_enqueue_threads` | Number of threads to enqueue the parsed example queue. Using multiple threads to enqueue the parsed example queue helps maintain a full queue when the subsequent computations overall are cheaper than parsing. In order to have predictable and repeatable order of reading and enqueueing, such as in prediction and evaluation mode, `num_enqueue_threads` should be 1. |\n| `parse_fn` | Parsing function, takes `Example` Tensor returns parsed representation. If `None`, no parsing is done. |\n| `name` | Name of resulting op. |\n| `read_batch_size` | An int or scalar `Tensor` specifying the number of records to read at once. If `None`, defaults to `batch_size`. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A dict of `Tensor` or `SparseTensor` objects for each in `features`. ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|--------------|---------------------|\n| `ValueError` | for invalid inputs. |\n\n\u003cbr /\u003e"]]