title: Translation Model Predictions: TypeError: Object of type 'EagerTensor' is not JSON serializable
body: <p>I have followed the translation colab notebook tutorial as suggested <a href="https://github.com/tensorflow/tensor2tensor/blob/master/tensor2tensor/notebooks/Transformer_translate.ipynb" rel="noreferrer">by Google's tensor2tensor repository</a></p>
  
  <p>After exporting the model and uploading it to Google's AI Platform engine for online prediction, I am having trouble making requests to the model. </p>
  
  <p>I believe the input to the translation model is a tensor of the source text. But I am receiving an error that <code>TypeError: Object of type 'EagerTensor' is not JSON serializable</code></p>
  
  <pre><code>
  def encode(input_str, output_str=None):
    """Input str to features dict, ready for inference"""
    inputs = encoders["inputs"].encode(input_str) + [1]  # add EOS id
    batch_inputs = tf.reshape(inputs, [1, -1, 1])  # Make it 3D.
    return {"inputs": batch_inputs}
  
  enfr_problem = problems.problem(PROBLEM)
  encoders = enfr_problem.feature_encoders(DATA_DIR)
  
  encoded_inputs = encode("Some text")
  model_output = predict_json('project_name','model_name', encoded_inputs,'version_1')["outputs"]
  </code></pre>
  
  <p>I've tried converting the tensor to numpy but still no luck. Could someone point me in the right direction?</p>