Skip to Content
TensorFlow 2 Pocket Reference
book

TensorFlow 2 Pocket Reference

by KC Tung
July 2021
Intermediate to advanced
253 pages
5h 1m
English
O'Reilly Media, Inc.
Content preview from TensorFlow 2 Pocket Reference

Chapter 5. Data Pipelines for Streaming Ingestion

Data ingestion is an important part of your workflow. There are several steps to perform before raw data is in the correct input format expected by the model. These steps are known as the data pipeline. Steps in a data pipeline are important because they will also be applied to the production data, which is the data consumed by the model when the model is deployed. Whether you are in the process of building and debugging a model or getting it ready for deployment, you need to format the raw data for the model’s consumption.

It is important to use the same series of steps in the model-building process as you do in deployment planning, so that the test data is processed the same way as the training data.

In Chapter 3 you learned how the Python generator works, and in Chapter 4 you learned how to use the flow_from_directory method for transfer learning. In this chapter, you will see more of the tools that TensorFlow provides to handle other data types, such as text and numeric arrays. You’ll also learn how to handle another type of file structure for images. File organization becomes especially important when handling text or images for model training because it is common to use directory names as labels. This chapter will recommend a practice for directory organization when it comes to building and training a text or image classification model.

Streaming Text Files with the text_dataset_from_directory Function

You can stream pretty ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The TensorFlow Workshop

The TensorFlow Workshop

Matthew Moocarme, Abhranshu Bagchi, Anthony So, Anthony Maddalone

Publisher Resources

ISBN: 9781492089179Errata PageSupplemental Content