title: Tensorflow Serving Predict REST API 'not formatted correctly for base64 data' Error
body: <p>I have saved a Tensorflow model and am serving it using Tensorflow Serving (tensorflow/serving:1.12.0 and tensorflow/serving:1.12.0-gpu). </p>
  
  <p>I want to use the Predict REST API, but call is failing with 'not formatted correctly for base64 data' error.</p>
  
  <p>Request:</p>
  
  <p>POST /v1/models/payfraud:predict</p>
  
  <pre><code>{
    "inputs": [
      {
        "payFraudInput": [[44.26, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0]]
      }
    ]
  }
  </code></pre>
  
  <p>Response:</p>
  
  <p>400</p>
  
  <pre><code>{
      "error": "JSON Value: {\n    \"payFraudInput\": [\n        [\n            44.26,\n            0,\n            0,\n            0,\n            0,\n            1,\n            0,\n            0,\n            0,\n            0,\n            0,\n            0,\n            0,\n            0\n        ]\n    ]\n} not formatted correctly for base64 data"
  }
  </code></pre>
  
  <p>The model input is expecting DT_FLOAT, so I think I shouldn't need base64 encoding.</p>
  
  <p>POST /v1/models/payfraud/versions/1/metadata</p>
  
  <pre><code>{
      "model_spec": {
          "name": "payfraud",
          "signature_name": "",
          "version": "1"
      },
      "metadata": {
          "signature_def": {
              "signature_def": {
                  "predict_fraud": {
                      "inputs": {
                          "payFraudInput": {
                              "dtype": "DT_FLOAT",
                              "tensor_shape": {
                                  "dim": [
                                      {
                                          "size": "-1",
                                          "name": ""
                                      },
                                      {
                                          "size": "15",
                                          "name": ""
                                      }
                                  ],
                                  "unknown_rank": false
                              },
                              "name": "payFraudInput:0"
                          }
                      },
                      "outputs": {
                          "payFraudOutput": {
                              "dtype": "DT_FLOAT",
                              "tensor_shape": {
                                  "dim": [
                                      {
                                          "size": "-1",
                                          "name": ""
                                      },
                                      {
                                          "size": "2",
                                          "name": ""
                                      }
                                  ],
                                  "unknown_rank": false
                              },
                              "name": "payFraudOutput:0"
                          }
                      },
                      "method_name": "tensorflow/serving/predict"
                  },
                  "serving_default": {
                      "inputs": {
                          "inputs": {
                              "dtype": "DT_STRING",
                              "tensor_shape": {
                                  "dim": [],
                                  "unknown_rank": true
                              },
                              "name": "tf_example:0"
                          }
                      },
                      "outputs": {
                          "classes": {
                              "dtype": "DT_STRING",
                              "tensor_shape": {
                                  "dim": [
                                      {
                                          "size": "-1",
                                          "name": ""
                                      },
                                      {
                                          "size": "2",
                                          "name": ""
                                      }
                                  ],
                                  "unknown_rank": false
                              },
                              "name": "index_to_string_Lookup:0"
                          },
                          "scores": {
                              "dtype": "DT_FLOAT",
                              "tensor_shape": {
                                  "dim": [
                                      {
                                          "size": "-1",
                                          "name": ""
                                      },
                                      {
                                          "size": "2",
                                          "name": ""
                                      }
                                  ],
                                  "unknown_rank": false
                              },
                              "name": "TopKV2:0"
                          }
                      },
                      "method_name": "tensorflow/serving/classify"
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>This is how the model is saved:</p>
  
  <pre class="lang-py prettyprint-override"><code>    prediction_signature = (
        tf.saved_model.signature_def_utils.build_signature_def(
            inputs={"payFraudInput": tensor_info_x},
            outputs={"payFraudOutput": tensor_info_y},
            method_name=tf.saved_model.signature_constants.PREDICT_METHOD_NAME))
  
      classification_signature = (
         tf.saved_model.signature_def_utils.build_signature_def(
            inputs={
                tf.saved_model.signature_constants.CLASSIFY_INPUTS:
                    classification_inputs
            },
            outputs={
                tf.saved_model.signature_constants.CLASSIFY_OUTPUT_CLASSES:
                    classification_outputs_classes,
                tf.saved_model.signature_constants.CLASSIFY_OUTPUT_SCORES:
                    classification_outputs_scores
            },
            method_name=tf.saved_model.signature_constants.CLASSIFY_METHOD_NAME))
  
      export_path = os.path.join(tf.compat.as_bytes(export_dir), tf.compat.as_bytes("1"))
      print('Exporting trained model to ', export_path)
      builder = tf.saved_model.builder.SavedModelBuilder(export_path)
      builder.add_meta_graph_and_variables( sess, [tf.saved_model.tag_constants.SERVING],
          signature_def_map={
              'predict_fraud':
                   prediction_signature,
               tf.saved_model.signature_constants.DEFAULT_SERVING_SIGNATURE_DEF_KEY:
                   classification_signature,
          },
          main_op=tf.tables_initializer(),
          strip_default_attrs=True)
  
      builder.save()
      print('Done exporting!')
  </code></pre>
  
  <p>Trying b64 also doesn't work:</p>
  
  <p>Request</p>
  
  <pre><code>{
    "inputs": [
      {
        "payFraudInput":{"b64":"NDQuMjYsIDAsIDAsIDAsIDAsIDEsIDAsIDAsIDAsIDAsIDAsIDAsIDAsIDA="}
      }
    ]
  }
  </code></pre>
  
  <p>Response</p>
  
  <pre><code>{
      "error": "JSON Value: {\n    \"payFraudInput\": {\n        \"b64\": \"NDQuMjYsIDAsIDAsIDAsIDAsIDEsIDAsIDAsIDAsIDAsIDAsIDAsIDAsIDA=\"\n    }\n} not formatted correctly for base64 data"
  }
  </code></pre>
  
  <p>What am I doing wrong?</p>