Created
August 28, 2018 16:10
-
-
Save lakshmanok/fb531a388e297637be4c8d3a83881fcc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def serving_input_fn(): | |
# Note: only handles one image at a time | |
feature_placeholders = {'image_bytes': | |
tf.placeholder(tf.string, shape=())} | |
image, _ = read_and_preprocess( | |
tf.squeeze(feature_placeholders['image_bytes'])) | |
features = { | |
'image': tf.expand_dims(image, 0) | |
} | |
return tf.estimator.export.ServingInputReceiver(features, feature_placeholders) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment