TensorFlow 2.0 Beta is available Learn more

tfds.file_adapter.TFRecordExampleAdapter

Class TFRecordExampleAdapter

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

Inherits From: FileFormatAdapter

View source

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__

View source

__init__(example_specs)

Properties

filetype_suffix

Methods

dataset_from_filename

View source

dataset_from_filename(filename)

write_from_generator

View source

write_from_generator(
    generator,
    output_files
)

write_from_pcollection

View source

write_from_pcollection(
    pcollection,
    file_path_prefix,
    num_shards
)