class documentation

Class for writing TFRecords to disk.

Example Usage:

with TFRecordsWriter("/path/for/tf.records", num_shards=5) as writer:
    for tf_example in tf_examples:
        writer.write(tf_example)
Parameters
tf_records_paththe path to write the .tfrecords file. If sharding is requested -%%05d-of-%%05d is appended to the path
num_shardsan optional number of shards to split the records into (using a round robin strategy). If omitted, no sharding is used
Method __enter__ Undocumented
Method __exit__ Undocumented
Method __init__ Undocumented
Method write Writres the tf.train.Example proto to disk.
Instance Variable num_shards Undocumented
Instance Variable tf_records_path Undocumented
Instance Variable _idx Undocumented
Instance Variable _num_shards Undocumented
Instance Variable _writers Undocumented
Instance Variable _writers_context Undocumented
def __enter__(self): (source)

Undocumented

def __exit__(self, *args): (source)

Undocumented

def __init__(self, tf_records_path, num_shards=None): (source)

Undocumented

def write(self, tf_example): (source)

Writres the tf.train.Example proto to disk.

Parameters
tf_examplea tf.train.Example proto
num_shards: None = (source)

Undocumented

tf_records_path = (source)

Undocumented

Undocumented

_num_shards = (source)

Undocumented

_writers = (source)

Undocumented

_writers_context = (source)

Undocumented