We can get attribute errors on failed pickling of some tf objects (optimizers)
@@ -874,6 +874,7 @@ def should_pickle(key, val):
tf.errors.InternalError,
OverflowError,
TypingError,
+ AttributeError,
) as e:
warn("Did not pickle {}: {}".format(key, e))
return False
