- ray.tune.utils.diagnose_serialization(trainable: Callable)#
Utility for detecting why your trainable function isn’t serializing.
trainable – The trainable object passed to tune.Tuner(trainable). Currently only supports Function API.
bool | set of unserializable objects.
import threading # this is not serializable e = threading.Event() def test(): print(e) diagnose_serialization(test) # should help identify that 'e' should be moved into # the `test` scope. # correct implementation def test(): e = threading.Event() print(e) assert diagnose_serialization(test) is True
DeveloperAPI: This API may change across minor Ray releases.