Reputation: 35
When using an estimator in tensorflow and passing the inputs using tf.estimator.inputs.numpy_input_function()
, what are the names of the tensors being created for the features and labels' inputs.
If I print out the name of all the placeholders in my graph I get the following:
name: "enqueue_input/Placeholder"
name: "enqueue_input/Placeholder_1"
name: "enqueue_input/Placeholder_2"
However, the shape of those tensors were not specified so I cannot tell which is which or why there are 3 of them instead of only one features and one labels tensors.
I realize this question was also asked here: TensorFlow: What are the input nodes for tf.Estimator models
But no one answered.
Upvotes: 2
Views: 963
Reputation: 5936
numpy_input_fn
has two important arguments: x
and y
. x
is a dictionary that matches the names of feature columns to arrays containing feature data. y
is an array that contains the labels for the features in x
.
For example, the following code associates the feature named x_coord
with Label 1 when the value is 0.5 and with Label 2 when the value is 1.2:
train_input = tf.estimator.inputs.numpy_input_fn(
x={"x_coord": np.array([0.5, 1.2])}, y=np.array([1, 2]))
Upvotes: 1