I'm deploying a tensorflow.serving endpoint with a custom inference.py script via the entry point parameter
model = Model(role='xxx',
framework_version='2.2.0',
entry_point='inference.py',
model_data='xxx')
predictor = model.deploy(instance_type='xxx',
initial_instance_count=1,
endpoint_name='xxx')
inference.py constains an input_handler and an output_handler functions, but when i call predict with:
model = Predictor(endpoint_name='xxx')
url = 'xxx'
input = {
'instances': [url]
}
predictions = model.predict(input)
I'm getting the following error:
botocore.errorfactory.ModelError: An error occurred (ModelError) when calling the InvokeEndpoint operation: Received client error (400) from model with message "{"error": "Failed to process element: 0 of 'instances' list. Error: Invalid argument: JSON Value: "xxx" Type: String is not of expected type: float" }"
It seems the function is never calling the input_handler function in inference.py script. Do you know why this might be happening?