KeyError in Tensorflow when calling predict on trained model
<p>I have trained a LinearRegressor with two features: x,y and the label: l</p>

<pre><code>def train_input_fn():
    x = [1,2,3,4]
    y = [2,3,4,5]
    feature_cols = tf.constant(x)
    labels = tf.constant(y)
    return feature_cols, labels    

x = tf.contrib.layers.real_valued_column("x")
y = tf.contrib.layers.real_valued_column("y")    
m = tf.contrib.learn.LinearRegressor(feature_columns=[ x,y],
                                      model_dir=model_dir)
m.fit(input_fn=train_input_fn, steps=100)
</code></pre>

<p>After training I want to predict from two new values</p>

<pre><code>new_sample = np.array([20,20])
m.predict(new_sample)
</code></pre>

<p>but I get this error message when calling predict</p>

<pre><code>File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/layers/python/layers/feature_column.py", line 870, in insert_transformed_feature
input_tensor = columns_to_tensors[self.name]
KeyError: 'x'
</code></pre>

<p>Does anyone know why I get KeyError?</p>