I have a tensorflow model which takes two 2d arrays as input.
This is how I trained the model.
x.shape == (100, 250)
y.shape == (100, 10)
model.fit([x,y], y_train)
Now I'm using tensorflow serving API for deploying into production. Now when I tried to make a api request for predictions I'm getting an error
"{'error': 'instances is a plain list, but expecting list of objects as multiple input tensors required as per tensorinfo_map'}"
data1 = json.dumps({"signature_name": "serving_default",
"instances": [x.tolist(), y.tolist()]})
# both x and y are numpy 2d array
json_response = requests.post('http://44.287.13.8:9000/v1/models/context_model/versions/1:predict',
data=data1, headers=headers)
pred = json.loads(json_response.text)
print(pred)
{'error': 'instances is a plain list, but expecting list of objects as multiple input tensors required as per tensorinfo_map'}
!saved_model_cli show --dir PathOfModel \ --tag_set serve --signature_def predict. Thanks! - Tensorflow Support