Merge pull request #21703 from jppgks:patch-1

PiperOrigin-RevId: 236362985
This commit is contained in:
TensorFlower Gardener 2019-03-01 13:09:40 -08:00
commit 9bed84f9c2

View File

@ -91,9 +91,10 @@ def main(_):
predict_features = tf.data.Dataset.from_tensors([[1.]]).repeat(10)
return predict_features
predictions = estimator.predict(input_fn=predict_input_fn)
# TODO(anjalsridhar): This returns a generator object, figure out how to get
# meaningful results here.
prediction_iterable = estimator.predict(input_fn=predict_input_fn)
# Create a list containing each of the prediction dictionaries that map
# the key 'logits' to an array of model outputs.
predictions = [prediction_iterable.next() for _ in range(10)]
print("Prediction results: {}".format(predictions))