TFRecordReader
Inherits From: ReaderBase
Defined in tensorflow/python/ops/io_ops.py
.
See the guide: Inputs and Readers > Readers
A Reader that outputs the records from a TFRecords file.
See ReaderBase for supported methods.
Readers are not compatible with eager execution. Instead, please use tf.data
to get data into your model.
reader_ref
Op that implements the reader.
supports_serialize
Whether the Reader implementation can serialize its state.
__init__
__init__( name=None, options=None )
Create a TFRecordReader.
name
: A name for the operation (optional).options
: A TFRecordOptions object (optional).num_records_produced
num_records_produced(name=None)
Returns the number of records this reader has produced.
This is the same as the number of Read executions that have succeeded.
name
: A name for the operation (optional).An int64 Tensor.
num_work_units_completed
num_work_units_completed(name=None)
Returns the number of work units this reader has finished processing.
name
: A name for the operation (optional).An int64 Tensor.
read
read( queue, name=None )
Returns the next record (key, value) pair produced by a reader.
Will dequeue a work unit from queue if necessary (e.g. when the Reader needs to start reading from a new file since it has finished with the previous file).
queue
: A Queue or a mutable string Tensor representing a handle to a Queue, with string work items.name
: A name for the operation (optional).A tuple of Tensors (key, value). key
: A string scalar Tensor. value
: A string scalar Tensor.
read_up_to
read_up_to( queue, num_records, name=None )
Returns up to num_records (key, value) pairs produced by a reader.
Will dequeue a work unit from queue if necessary (e.g., when the Reader needs to start reading from a new file since it has finished with the previous file). It may return less than num_records even before the last batch.
queue
: A Queue or a mutable string Tensor representing a handle to a Queue, with string work items.num_records
: Number of records to read.name
: A name for the operation (optional).A tuple of Tensors (keys, values). keys
: A 1-D string Tensor. values
: A 1-D string Tensor.
reset
reset(name=None)
Restore a reader to its initial clean state.
name
: A name for the operation (optional).The created Operation.
restore_state
restore_state( state, name=None )
Restore a reader to a previously saved state.
Not all Readers support being restored, so this can produce an Unimplemented error.
state
: A string Tensor. Result of a SerializeState of a Reader with matching type.name
: A name for the operation (optional).The created Operation.
serialize_state
serialize_state(name=None)
Produce a string tensor that encodes the state of a reader.
Not all Readers support being serialized, so this can produce an Unimplemented error.
name
: A name for the operation (optional).A string Tensor.
© 2018 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/TFRecordReader