Tensorflow数据集API:具有木地板文件的输入管道 [英] Tensorflow Dataset API: input pipeline with parquet files

查看:132
本文介绍了Tensorflow数据集API:具有木地板文件的输入管道的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Dataset API设计输入管道.我正在处理镶木地板文件.将它们添加到我的管道中的好方法是什么?

I am trying to design an input pipeline with Dataset API. I am working with parquet files. What is a good way to add them to my pipeline?

推荐答案

我们发布了 Petastorm ,一个开放源代码库,可让您直接通过Tensorflow Dataset API使用Apache Parquet文件.

We have released Petastorm, an open source library that allows you to use Apache Parquet files directly via Tensorflow Dataset API.

这是一个小的示例:

Here is a small example:

   with Reader('hdfs://.../some/hdfs/path') as reader:
        dataset = make_petastorm_dataset(reader)
        iterator = dataset.make_one_shot_iterator()
        tensor = iterator.get_next()
        with tf.Session() as sess:
            sample = sess.run(tensor)
            print(sample.id)

这篇关于Tensorflow数据集API:具有木地板文件的输入管道的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆