8

I have a tfrecord file and would like to import it in a pandas dataframe or numpy array.

I found tools to read tfrecords but they only work inside a tensorflow session, which is not the use case I have...

Thanks for any help I could get !

maxk
  • 161
  • 2
  • 7

1 Answers1

5

In Colab you can type (or on your cmd without !)

!pip install pandas-tfrecords

After installation you can use:

import pandas as pd
import pandas_tfrecords as pdtfr
pdtfr.tfrecords_to_pandas(file_paths=r'/folder/file.tfrecords')

Good luck!

Roelant
  • 4,508
  • 1
  • 32
  • 62