Once the chart is loaded, it is available in the current context, and you can transfer input through it to receive forecasts. Each use case is different, but the addition to your code will look something like this:
with tf.Session(graph=tf.Graph()) as sess: tf.saved_model.loader.load( sess, [tf.saved_model.tag_constants.SERVING], "/job/export/Servo/1503723455" ) prediction = sess.run( 'prefix/predictions/Identity:0', feed_dict={ 'Placeholder:0': [20.9], 'Placeholder_1:0': [1.8], 'Placeholder_2:0': [0.9] } ) print(prediction)
Here you need to know the names of what your prediction inputs will be. If you did not give them nave in your serving_fn , then they are by default equal to Placeholder_n , where n is the nth function.
The first argument to the sess.run line is the name of the prediction target. This will depend on your use case.
source share