Reputation: 865
I trained a model locally with TensorFlow and uploaded it to the Google Cloud ML Engine. Despite local tests with gcloud ml-engine local predict
work fine, using online prediction with gcloud ml-engine predict
fails with this error:
{ "error": "Prediction failed: Error during model execution: AbortionError(code=StatusCode.INVALID_ARGUMENT, details=\"NodeDef mentions attr 'output_type' not in Op output:int64; attr=T:type,allowed=[DT_FLOAT, DT_DOUBLE, DT_INT64, DT_INT32, DT_UINT8, DT_UINT16, DT_INT16, DT_INT8, DT_COMPLEX64, DT_COMPLEX128, DT_QINT8, DT_QUINT8, DT_QINT32, DT_HALF]; attr=Tidx:type,default=DT_INT32,allowed=[DT_INT32, DT_INT64]>; NodeDef: dnn/head/predictions/class_ids = ArgMax[T=DT_FLOAT, Tidx=DT_INT32, _output_shapes=[[-1]], output_type=DT_INT64, _device=\"/job:localhost/replica:0/task:0/cpu:0\"](dnn/head/logits, dnn/head/predictions/class_ids/dimension)\n\t [[Node: dnn/head/predictions/class_ids = ArgMax[T=DT_FLOAT, Tidx=DT_INT32, _output_shapes=[[-1]], output_type=DT_INT64, _device=\"/job:localhost/replica:0/task:0/cpu:0\"](dnn/head/logits, dnn/head/predictions/class_ids/dimension)]]\")" }
Upvotes: 0
Views: 237
Reputation: 865
The problem were different versions of TensorFlow: 1.4.1 on my local machine, that I was using for training and 1.2 on Google Cloud. It's possible to specify version when you're using CLI tools, but not Google Cloud Web console, so the solution is to use gcloud ml-engine versions create
along with --runtime-version=1.4
parameter.
This answer helped (although there was another error message): https://stackoverflow.com/a/48080666/903919
Upvotes: 2