vahidk/tfrecord

Error in creating indices

nkundiushuti opened this issue · 0 comments

Running this function for a set of previously generated tfrecords
for path in self.tfrecords_path[self.split]:
tfrecord.tools.tfrecord2idx.create_index(path,path.replace('.tfrecord','.index'))

gives this error
Failed to parse TFRecord.
Printing the exception (which in my opinion is not handled correctly in the script)
read length must be non-negative or -1
Then the proto_len is computed as negative
-1920456895118704640
The data I am writing is audio (arrays of floats).
This function is not so transparent? What really is supposed to happen there and how this negative value appears?