# tf.contrib.data.ignore_errors

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/data/python/ops/error_ops.py#L24-L49) |

Creates a `Dataset` from another `Dataset` and silently ignores any errors. (deprecated)

    tf.contrib.data.ignore_errors()

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

Use this transformation to produce a dataset that contains the same elements
as the input, but silently drops any elements that caused an error. For
example:

    dataset = tf.data.Dataset.from_tensor_slices([1., 2., 0., 4.])

    # Computing `tf.debugging.check_numerics(1. / 0.)` will raise an
    InvalidArgumentError.
    dataset = dataset.map(lambda x: tf.debugging.check_numerics(1. / x, "error"))

    # Using `ignore_errors()` will drop the element that causes an error.
    dataset =
        dataset.apply(tf.data.experimental.ignore_errors())  # ==> { 1., 0.5, 0.2
        }

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `Dataset` transformation function, which can be passed to [`tf.data.Dataset.apply`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/data/Dataset#apply). ||

<br />