Thank you so much for this repo. When using models with multiple models this code will fail obviously. Here is how to do it for multiple inputs. Wasn't sure where to PR so just opening this issue to help others trying the same.
full_model = tf.function(lambda x: model(x))
get_concrete_func_x = []
for i in range(len(model.inputs)):
get_concrete_func_x.append(
tf.TensorSpec(
model.inputs[i].shape,
model.inputs[i].dtype,
name=model.inputs[i].name
)
)
# basically x should be a TensorSpec or tuple of them.
# don't put a generator directly or it will fail too.
get_concrete_func_x = tuple(get_concrete_func_x)
full_model = full_model.get_concrete_function(x=get_concrete_func_x)
Thank you so much for this repo. When using models with multiple models this code will fail obviously. Here is how to do it for multiple inputs. Wasn't sure where to PR so just opening this issue to help others trying the same.