I have deployed 3 models under one endpoint using multidatamodel within AWS Sagemaker and am having trouble trying to invoke it. We are using a TensorFlowPredictor object to try and run an inference but we keep receiving the error:
**ModelError: An error occurred (ModelError) when calling the InvokeEndpoint operation: Received client error (400) from model with message "unable to evaluate payload provided"**
We have tried different ways to try and encode the data (a jpg image of a dog), but we keep receiving the same error. We have tried JSON encoding the data too.
data = load_img('dog.jpg', target_size=(224, 224))
data = img_to_array(data)
data = data.astype('float32')
data = data/255.0
data = data.reshape(1, 224, 224, 3)
payload = {'instances': data}
^ This is how we are currently preprocessing the image before we invoke the endpoint like:
predictor.predict(data=payload, initial_args={'TargetModel':'model1.tar.gz'})
Our model is an EfficientNet which accepts 224x224 images.
Any help would be much appreciated!