From 8da8053726ef25be9a067d9be9d69a0e5f363b60 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Fri, 10 Jan 2020 13:41:06 +0200 Subject: [PATCH] Do not store keras model network design if it cannot be serialized --- trains/binding/frameworks/tensorflow_bind.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/trains/binding/frameworks/tensorflow_bind.py b/trains/binding/frameworks/tensorflow_bind.py index af53c93f..6caaf49b 100644 --- a/trains/binding/frameworks/tensorflow_bind.py +++ b/trains/binding/frameworks/tensorflow_bind.py @@ -1283,7 +1283,11 @@ class PatchKerasModelIO(object): filepath = kwargs['filepath'] if 'filepath' in kwargs else args[0] # this will already generate an output model - config = self._updated_config() + try: + config = self._updated_config() + except Exception as ex: + # we failed to convert the network to json, for some reason (most likely internal keras error) + config = {} # check if object already has InputModel if not hasattr(self, 'trains_out_model'):