I am trying to use Google Cloud ML to host the Tensorflow model and get forecasts. I have a preliminary model that I uploaded to the cloud, and I created the model and version in the Cloud ML console.
I followed the instructions from here to prepare my details for requesting online forecasts. For Python method and method, glcoudI get the same error. For simplicity, I will post a method gcloud:
I run gcloud ml-engine predict --model spell_correction --json-instances test.jsonwhere test.jsonis my input file (a JSON array with a name instances). I get the following result:
ERROR: (gcloud.ml-engine.predict) HTTP request failed. Response: {
"error": {
"code": 400,
"message": "Precondition check failed.",
"status": "FAILED_PRECONDITION"
}
}
How can I get more details about this? The exact error occurs when trying through Python, and there is an object googleapiclient.http.HttpRequestcontaining the error. I just want to know why this error happens differently than this general error. Does anyone know how to get more information through a Python method or method gcloud? I assume that since this is the same error, it is the same underlying cause.
Conclusion gcloud ml-engine models list:
NAME DEFAULT_VERSION_NAME
spell_correction testing
Conclusion gcloud ml-engine versions list --model spell_correction
NAME DEPLOYMENT_URI
testing gs://<my-bucket>/output/1/
test.json: {"instances": [{"tokens": [[9], [4], [11], [9]], "mask": [[18], [7], [12], [30]], "keep_prob": 1.0, "beam": 64}]}
My model inputs:
tokens: tf.placeholder(tf.int32, shape=[None, None])
mask: tf.placeholder(tf.int32, shape=[None, None])
keep_prob: tf.placeholder(tf.float32)
beam: tf.placeholder(tf.int32)
When called via python request_bodyis just test.jsonlike a string.