# tf.keras.experimental.terminate_keras_multiprocessing_pools

<br />

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 1 version](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/keras/experimental/terminate_keras_multiprocessing_pools) | [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.0.0/tensorflow/python/keras/utils/data_utils.py#L450-L554) |

Destroy Keras' multiprocessing pools to prevent deadlocks.

#### View aliases


**Compat aliases for migration**

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

[`tf.compat.v1.keras.experimental.terminate_keras_multiprocessing_pools`](https://www.tensorflow.org/api_docs/python/tf/keras/experimental/terminate_keras_multiprocessing_pools)

<br />

    tf.keras.experimental.terminate_keras_multiprocessing_pools(
        grace_period=0.1, use_sigkill=False
    )

In general multiprocessing.Pool can interact quite badly with other, seemingly
unrelated, parts of a codebase due to Pool's reliance on fork. This method
cleans up all pools which are known to belong to Keras (and thus can be safely
terminated).

<br />

<br />

<br />

| ## Args ||
|---|---|
| `grace_period` | Time (in seconds) to wait for process cleanup to propagate. |
| `use_sigkill` | Boolean of whether or not to perform a cleanup pass using SIGKILL. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A list of human readable strings describing all issues encountered. It is up to the caller to decide whether to treat this as an error condition. ||

<br />