Apply to speak at TensorFlow World. Deadline April 23rd. Propose talk

tfds.file_adapter.TFRecordExampleAdapter

Class TFRecordExampleAdapter

Inherits From: FileFormatAdapter

Defined in core/file_format_adapter.py.

Writes/Reads serialized Examples protos to/from TFRecord files.

Constraints on generators:

  • The generator must yield feature dictionaries (dict<str feature_name, feature_value>).
  • The allowed feature types are int, float, and str (or bytes in Python 3; unicode strings will be encoded in utf-8), or lists thereof.

__init__

__init__(example_reading_spec)

Construcs a TFRecordExampleAdapter.

Args:

example_reading_spec (dict): feature name to tf.FixedLenFeature or tf.VarLenFeature. Passed to tf.parse_single_example.

Properties

filetype_suffix

Methods

dataset_from_filename

dataset_from_filename(filename)

write_from_generator

write_from_generator(
    generator_fn,
    output_files
)