feed-dict is the slowest way to feed data into TensorFlow model. The Tensor flow DataSet API is the best way to feed data into your models. It also ensures that the GPU has never to wait for new data to come in.

The Dataset is a high-level TensorFlow APIs which makes a more streamlined and efficient way of creating data input pipelines. Reading the data from CSV or text files or Numpy array and transforming it, shuffling it batch it. It’s all be automatically optimized and paralleled to provide efficient consumption of data.

In this tutorial, we are going to see how we can create an input pipeline from a CSV file.

The CSV file is a popular format for storing tabular data. The Dataset API provide a class to extract records from one or more CSV files. Given one or more filenames and a list of defaults, a CsvDataset will produce a tuple of elements whose types correspond to the types of the defaults provided, per CSV record.

  • Default Values: A list of default values for One per column of CSV data. Each item in the list is either a valid CSV DType or a Tensor object with one of the types.
  • Select Columns:A sorted list of column indices to select from the input data. If specified, only this subset of columns will be parsed. Defaults to parsing all columns.