如何在 Pandas 数据框中导入 tfrecord 文件? [英] How to import tfrecord files in a pandas dataframe?
本文介绍了如何在 Pandas 数据框中导入 tfrecord 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个 tfrecord 文件,想将它导入到 Pandas 数据框或 numpy 数组中.
I have a tfrecord file and would like to import it in a pandas dataframe or numpy array.
我找到了读取 tfrecords 的工具,但它们只能在 tensorflow 会话中工作,这不是我的用例...
I found tools to read tfrecords but they only work inside a tensorflow session, which is not the use case I have...
感谢您的帮助!
推荐答案
在 Colab 中,您可以输入(或在您的 cmd 上不输入!)
In Colab you can type (or on your cmd without !)
!pip install pandas-tfrecords
安装后即可使用:
import pandas as pd
import pandas_tfrecords as pdtfr
pdtfr.tfrecords_to_pandas(file_paths=r'/folder/file.tfrecords')
祝你好运!
这篇关于如何在 Pandas 数据框中导入 tfrecord 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文