title: Cast string to float is not supported in Linear Model
body: <p>I keep getting this error in my linear model:</p>
  
  <blockquote>
    <p>Cast string to float is not supported</p>
  </blockquote>
  
  <p>Specifically, the error is on this line:</p>
  
  <pre><code>results = m.evaluate(input_fn=lambda: input_fn(df_test), steps=1)
  </code></pre>
  
  <p>If it helps, here's the stack trace:</p>
  
  <pre><code> File "tensorflowtest.py", line 164, in &lt;module&gt;
      m.fit(input_fn=lambda: input_fn(df_train), steps=int(100))
    File "/home/computer/.local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/linear.py", line 475, in fit
      max_steps=max_steps)
    File "/home/computer/.local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 333, in fit
      max_steps=max_steps)
    File "/home/computer/.local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 662, in _train_model
      train_op, loss_op = self._get_train_ops(features, targets)
    File "/home/computer/.local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 963, in _get_train_ops
      _, loss, train_op = self._call_model_fn(features, targets, ModeKeys.TRAIN)
    File "/home/computer/.local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 944, in _call_model_fn
      return self._model_fn(features, targets, mode=mode, params=self.params)
    File "/home/computer/.local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/linear.py", line 220, in _linear_classifier_model_fn
      loss = loss_fn(logits, targets)
    File "/home/computer/.local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/linear.py", line 141, in _log_loss_with_two_classes
      logits, math_ops.to_float(target))
    File "/home/computer/.local/lib/python2.7/site-packages/tensorflow/python/ops/math_ops.py", line 661, in to_float
      return cast(x, dtypes.float32, name=name)
    File "/home/computer/.local/lib/python2.7/site-packages/tensorflow/python/ops/math_ops.py", line 616, in cast
      return gen_math_ops.cast(x, base_type, name=name)
    File "/home/computer/.local/lib/python2.7/site-packages/tensorflow/python/ops/gen_math_ops.py", line 419, in cast
      result = _op_def_lib.apply_op("Cast", x=x, DstT=DstT, name=name)
    File "/home/computer/.local/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 749, in apply_op
      op_def=op_def)
    File "/home/computer/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2380, in create_op
      original_op=self._default_original_op, op_def=op_def)
    File "/home/computer/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1298, in __init__
      self._traceback = _extract_stack()
  
  UnimplementedError (see above for traceback): Cast string to float is not supported
           [[Node: ToFloat = Cast[DstT=DT_FLOAT, SrcT=DT_STRING, _device="/job:localhost/replica:0/task:0/cpu:0"](Reshape_1)]]
  </code></pre>
  
  <p>The model is an adaptation of the tutorial from <a href="https://www.tensorflow.org/versions/r0.11/tutorials/wide/index.html" rel="noreferrer">here</a> and <a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/learn/wide_n_deep_tutorial.py" rel="noreferrer">here</a>. The tutorial code does run, so it's not a problem with my TensorFlow installation.  </p>
  
  <p>The input CSV is data in the form of many binary categorical columns (<code>yes</code>/<code>no</code>). Initially, I represented the data in each column as 0's and 1's, but I get the same error when I change it to <code>y</code>s and <code>n</code>s.  </p>
  
  <p>How do I fix this?</p>