tf.keras.experimental.terminate_keras_multiprocessing_pools

View source on GitHub

Destroy Keras' multiprocessing pools to prevent deadlocks.

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).

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.
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.

© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/keras/experimental/terminate_keras_multiprocessing_pools