Created
March 16, 2018 16:36
-
-
Save hsiaoer/acd9209f471dc836ca221834aa12a6c4 to your computer and use it in GitHub Desktop.
This file contains 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 model_fn(features, labels, mode, params): | |
... | |
logits = model(image, training=False) | |
predictions = { | |
'classes': tf.argmax(logits, axis=1), | |
'probabilities': tf.nn.softmax(logits, name='softmax_tensor'), | |
} | |
if mode == tf.estimator.ModeKeys.PREDICT: | |
return tf.estimator.EstimatorSpec( | |
mode=tf.estimator.ModeKeys.PREDICT, | |
predictions=predictions, | |
export_outputs={ | |
'classify': tf.estimator.export.PredictOutput(predictions) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment