python - How to get the total number of entries contained in a TFRecord file? -


i able write , read tfrecord files tensorflow. how can total number of entries contained in tfrecord file? there api count?

the tfrecords file format sequence of structures in form:

struct tfrecords {     uint64_t length;     uint32_t length_checksum;     uint8_t data[length];     uint32_t data_checksum; } × n 

there no metadata tell how many entries there, reliable way total read whole file (thus no apis total) , call num_records_produced().

you write custom metadata containing number first record when producing tfrecords.

if sure every record has same length, number of entries decompressed_file_size / (length_of_each_record + 16).


Comments

Popular posts from this blog

loops - Spock: How to use test data with @Stepwise -

amazon web services - S3 Pre-signed POST validate file type? -