When I am trying to call my Sagemaker TF endpoint using API Gateway -> Lambda Func by passing a Base 64 String (an image) I am getting an unsupported string error. I also tried with application/Json but I am still getting the error. Need Suggestion.
In Notebook Instance this is how my input looks:
<CODE>
input = {
'instances': [{"b64": "iV"}]
}
In Lambda function I am doing this:
<CODE>
instance = [{"b64": "b64string"}]
pleasework=json.dumps({"instances": instance})
response = runtime.invoke_endpoint(EndpointName=ENDPOINT_NAME_BASE64,ContentType='string',Accept='string' ,Body=pleasework)
ERROR:
Inference Error:
An error occurred (ModelError) when calling the InvokeEndpoint operation: Received client error (415) from primary with message "{"error": "Unsupported Media Type: string"}".
Incase if I pass application/json I get this error:
Received client error (400) from primary with message "{ "error": "Failed to process element: 0 of 'instances' list. Error: INVALID_ARGUMENT: JSON Value: {\n "b64": "iV"\n} Type: Object is not of expected type: uint8"}"