<br />

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

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

#### View aliases


**Compat aliases for migration**

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

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

<br />

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

> [!WARNING]
> **Deprecated:** 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/api_docs/python/tf/data/TFRecordDataset)

<br />

<br />

<br />

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

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| An iterator of serialized TFRecords. ||

<br />

<br />

<br />

<br />

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

<br />