I am having a problem trying to invoke via HTTP rest request an online Prediction to a deployed model on Google AI Platform. I get the following error regardless of how I package the data. The error is:
Expected float32, got *******
I have confirmed the Google Credentials work and I can perform a query from my Android App to get information about the model and that is successful.
The issue I believe is with formatting of the data. I have followed the instructions at https://cloud.google.com/ml-engine/docs/online-predict and also at https://cloud.google.com/ml-engine/docs/v1/predict-request. I have tried to send various versions like
{"instances": [xxx]} where have formatted xxx in many different ways.
It should take as input a 3D array -basically the input to the model is a 150x150x3 array where each pixel has a value from 0 to 1.0 (float). Because the model wants a float input I can not convert the original 150x150x3 pixel values to base64. So, I am using the explanation at the link above for sending in a 3D array. I have tried so many different ways and do not know what to do at this point. Here is an image showing the 3D string array representing the scaled input input the model needs
Note: I am reading the data in from a JSON file -the same one I use below in a command line successful gcloud call to perform prediction. Here is an image illustrating the contents.
Note: I am able to do this on the command line using gcloud
as shown here