From 945d6f5f317c92dcc490f66137cda6861ef2b97d Mon Sep 17 00:00:00 2001 From: Jon Tamir Date: Wed, 4 Nov 2020 12:10:57 -0600 Subject: [PATCH] is_picklable: catch AttributeError (addresses #3771) (#4508) * is_picklable: catch AttributeError (addresses #3771) * edit Co-authored-by: Jirka Borovec Co-authored-by: chaton --- pytorch_lightning/utilities/parsing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytorch_lightning/utilities/parsing.py b/pytorch_lightning/utilities/parsing.py index c562f780e8..c823020575 100644 --- a/pytorch_lightning/utilities/parsing.py +++ b/pytorch_lightning/utilities/parsing.py @@ -61,7 +61,7 @@ def is_picklable(obj: object) -> bool: try: pickle.dumps(obj) return True - except pickle.PicklingError: + except (pickle.PicklingError, AttributeError): return False