I am trying to follow this tutorial of the Tensorflow: https://www.tensorflow.org/versions/master/tutorials/input_fn/index.html#building-the-input-fn
Defining the regressor:
regressor = tf.contrib.learn.DNNRegressor(
feature_columns=feature_cols,
hidden_units=[10,10]
)
Training it:
regressor.fit(input_fn=lambda: input_fn(training_set), steps=5500)
My problems come from the next step. They are about the result of the prediction.
Prediction:
The standard version that tutorial provided:
y = regressor.predict(input_fn=lambda: input_fn(prediction_set))
print ("Predictions: {}".format(str(y)))
But the output is not what I expect, it gives me:
Predictions: <generator object _infer_model_as_iterable at 0x7f8134159aa0>
And I also tried to inspect its type:
print type(y)
#return: <type 'generator'>
Can anyone explain the question?