title: export serving_input_fn(): ValueError: too many values to unpack (expected 2)
body: <p>I trained a Tensorflow Estimator Model. When I tried to export the model to <strong>saved_model.pb</strong> file I wrote the following code to serve the input function which I have to predict.</p>
  
  <pre><code>def csv_serving_input():
      feature_placeholders = {
          'renancy': tf.placeholder(tf.float32, [None]),
          'freq': tf.placeholder(tf.float32, [None]),
          'monetary': tf.placeholder(tf.float32, [None])
      }
      features = feature_placeholders
  
      return tf.estimator.export.ServingInputReceiver(features,
                                                      feature_placeholders)
  </code></pre>
  
  <p>and to export the model</p>
  
  <pre><code>model = "trained_model/cluster_01"
  export_dir = model_dir + "/export"
  estimator.export_savedmodel(export_dir, csv_serving_input)
  </code></pre>
  
  <p>It throws following error <strong>ValueError: too many values to unpack (expected 2)</strong></p>
  
  <p>I am posting full traceback error for the reference</p>
  
  <pre><code>&lt;ipython-input-93-ecb2562febb3&gt; in &lt;module&gt;()
  ----&gt; 1 estimator.export_savedmodel(export_dir, csv_serving_input_fn_vtwo)
  
  c:\users\madhivarman\appdata\local\programs\python\python35\lib\site-packages\tensorflow\contrib\learn\python\learn\estimators\estimator.py in export_savedmodel(self, export_dir_base, serving_input_fn, default_output_alternative_key, assets_extra, as_text, checkpoint_path, graph_rewrite_specs, strip_default_attrs)
     1386       input_ops = serving_input_fn()
     1387       input_alternatives, features = (
  -&gt; 1388           saved_model_export_utils.get_input_alternatives(input_ops))
     1389 
     1390       # TODO(b/34388557) This is a stopgap, pending recording model provenance.
  
  c:\users\madhivarman\appdata\local\programs\python\python35\lib\site-packages\tensorflow\python\util\deprecation.py in new_func(*args, **kwargs)
      248               'in a future version' if date is None else ('after %s' % date),
      249               instructions)
  --&gt; 250       return func(*args, **kwargs)
      251     return tf_decorator.make_decorator(
      252         func, new_func, 'deprecated',
  
  c:\users\madhivarman\appdata\local\programs\python\python35\lib\site-packages\tensorflow\contrib\learn\python\learn\utils\saved_model_export_utils.py in get_input_alternatives(input_ops)
      171     input_alternatives[DEFAULT_INPUT_ALTERNATIVE_KEY] = default_inputs
      172   else:
  --&gt; 173     features, unused_labels = input_ops
      174 
      175   if not features:
  
  ValueError: too many values to unpack (expected 2)
  </code></pre>
  
  <p>I have attached Github Repo for full <a href="https://github.com/Madhivarman/MachineLearning-NN-s/blob/master/Customer_Segmentation_TF.ipynb" rel="nofollow noreferrer">code reference</a></p>