# tf.io.tf_record_iterator

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/lib/io/tf_record.py#L153-L186) |

An iterator that read the records from a TFRecords file. (deprecated)

#### View aliases


**Main aliases**

\`tf.python_io.tf_record_iterator\`
**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.io.tf_record_iterator`](https://www.tensorflow.org/api_docs/python/tf/compat/v1/io/tf_record_iterator), [`tf.compat.v1.python_io.tf_record_iterator`](https://www.tensorflow.org/api_docs/python/tf/compat/v1/io/tf_record_iterator)

<br />

    tf.io.tf_record_iterator(
        path, options=None
    )

> [!WARNING]
> **Warning:** THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Use eager execution and: [`tf.data.TFRecordDataset(path)`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/data/TFRecordDataset)

<br />

<br />

<br />

| ## Args ||
|---|---|
| `path` | The path to the TFRecords file. |
| `options` | (optional) A TFRecordOptions object. |

<br />

#### Yields:

Strings.

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `IOError` | If `path` cannot be opened for reading. |

<br />