snwu
snwu

Reputation: 23

Numpy to TFRecords and back

How do you convert a numpy array to a TFRecords? How do you convert it back when running your model? I found this script https://gist.github.com/swyoon/8185b3dcf08ec728fb22b99016dd533f that converts numpy arrays to TFRecords but I don't understand how to get my data out of the TFRecord.

Upvotes: 0

Views: 2251

Answers (1)

snwu
snwu

Reputation: 23

Got it!!! https://github.com/Hvass-Labs/TensorFlow-Tutorials/blob/master/18_TFRecords_Dataset_API.ipynb This guy Magnus Erik Hvass Pedersen has an awsome tutorial on how to write and read from TFRecords. His script takes in images but it can easily converted to np arrays by replacing images for a slice of your numpy array.

Upvotes: 2

Related Questions