Numpy数组到TFrecord [英] Numpy array to TFrecord

查看:249
本文介绍了Numpy数组到TFrecord的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过tensorflow对象检测api训练自定义数据集.数据集包含numpy ndarray格式(uint8)的40k训练图像和标签.训练数据集shape = 2([40000,23456])且标签shape = 1([0 ...,3]).我想为此数据集生成tfrecord.我该怎么办?

I'm trying to train a custom dataset through tensorflow object detection api. Dataset contains 40k training images and labels which are in numpy ndarray format (uint8). training dataset shape=2 ([40000,23456]) and labels shape = 1 ([0..., 3]). I want to generate tfrecord for this dataset. how do I do that?

推荐答案

本教程将引导您完成从数据创建TFRecord的过程:

This tutorial will walk you through the process of creating TFRecords from your data:

https ://medium.com/mostly-ai/tensorflow-records-what-they-are-and-how-to-to-to-use-them-c46bc4bbb564

但是,现在有了使用数据集输入管道进行预处理的更简便方法.我更喜欢将数据保留为最原始的格式,并建立预处理管道来处理它.这是您要阅读以了解有关数据集预处理管道的主要指南:

However there are easier ways of dealing with preprocessing now using the Dataset input pipeline. I prefer to keep my data in it's most original format and build a preprocessing pipeline to deal with it. Here's the primary guide you want to read to learn about the Dataset preprocessing pipeline:

https://www.tensorflow.org/programmers_guide/datasets

这篇关于Numpy数组到TFrecord的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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