def AddShapesToGraphDef(session, out_node):
“”" Add shapes attribute to nodes of the graph.
Input graph here is the default graph in context.
Parameters
----------
session : tf.Session
Tensorflow session
out_node : String
Final output node of the graph.
Returns
-------
graph_def : Obj
tensorflow graph definition with shapes attribute added to nodes.
"""
graph_def = tf.graph_util.convert_variables_to_constants(
session,
session.graph.as_graph_def(add_shapes=True),
[out_node], ----> out_node
)
return graph_def
Please change the type of out_node from string to list to support multiple outputs.