title: How to convert a dict to tensors in tensorflow
body: <p>I am following the tutorial about tensorflow: <a href="https://www.tensorflow.org/tutorials/wide" rel="noreferrer">https://www.tensorflow.org/tutorials/wide</a></p>
  
  <p>There are lots of categorical features which have to be converted to sparse matrix with <code>tf.feature_column.categorical_column_with_vocabulary_list()</code>.</p>
  
  <p>BUT, I do not want to use the predefined Estimator, </p>
  
  <pre><code>m = tf.estimator.LinearClassifier(
      model_dir=model_dir, feature_columns=base_columns + crossed_columns)
  </code></pre>
  
  <p>I prefer to use a costumed NN model, with:</p>
  
  <pre><code>estimator = tf.contrib.learn.Estimator(model_fn=model)
  estimator.fit(input_fn=input_fn(df, num_epochs=100, shuffle=True), \ 
                steps=100)
  </code></pre>
  
  <p>So in <code>model()</code>, there will be </p>
  
  <pre><code> def model(features, labels, mode): 
      ...
      node = tf.add(tf.matmul(features, w), b)
      ...
  </code></pre>
  
  <p>Then, I got the errors like:</p>
  
  <pre><code> TypeError: Failed to convert object of type &lt;class 'dict'&gt; to Tensor.
   Contents: {'education': &lt;tf.Tensor
   'random_shuffle_queue_DequeueUpTo:1' shape=(?,) dtype=string&gt;, 'age':
   &lt;tf.Tensor 'random_shuffle_queue_DequeueUpTo:2' shape=(?,) dtype=float64&gt; ... 
  </code></pre>
  
  <p>My question is how to convert the <code>features</code> to a tensor that can be used as input.</p>
  
  <p>Hope I have described the question clear. Thank you in advance.</p>