I deployed a keras model onto gcloud ml-engine, but received above error upon attempted online prediction.
I saved and deployed by following @Chase Midler's sample code from here (which is an adaptation of Hayato Yoshikawa's sample code from here. However, it complained that no preprocess_image function existed. I assume this is a custom function for whatever one wants to do to the image before passing it through the model; is that correct? Hence, I simply commented that line out.
I proceeded to deploy the saved model to gcloud ml engine and attempt an online prediction. Unfortunately I received the following "unable to decode bytes as JPEG, PNG, GIF, or BMP" error:
{
"error": "Prediction failed: Error during model execution:
AbortionError(code=StatusCode.INVALID_ARGUMENT, details=
\"assertion failed: [Unable to decode bytes as JPEG, PNG, GIF, or BMP]\n\t
[[Node: import/decode_image/cond_jpeg/cond_png/cond_gif/Assert_1/
Assert = Assert[T=[DT_STRING], summarize=3, _device=
\"/job:localhost/replica:0/task:0/device:CPU:0\"](import/decode_image/cond_jpeg/
cond_png/cond_gif/is_bmp, import/decode_image/cond_jpeg/cond_png/
cond_gif/Assert_1/Assert/data_0)]]\")"
}
What could the problem be?