Suppose I saved a model with following code
tf.saved_model.simple_save(sess, export_dir, in={'input_x': x, 'input_y':y}, out={'output_z':z})
And now I load back the saved model in another python program as
with tf.Session() as sess:
tf.saved_model.loader.load(sess, ['serve'], export_dir)
Now the question is how can I grab handles of the x, y, z tensors by the 'input_x', 'input_y', 'output_z' keys I specified in the input/output argument when call simple_save() method?
The only solution I found online relies on explicitly naming the x, y, z tensor when create them, and then use these names to retrieve them from graph, which seems to be quite redundant as we have specified keys for them in calling simple_save().