Open zandvakiliramin opened 1 month ago
I found where the problem may be, the following code is the inference.py of sagemaker jumpstart
def input_fn(input_data, content_type):
"""
Args:
input_data: the request payload serialized in the content_type format
content_type: the request content_type
"""
if content_type == "application/x-image":
decoded = Image.open(io.BytesIO(input_data))
else:
raise ValueError(f"Type [{content_type}] not supported.")
preprocess = transforms.Compose([transforms.ToTensor()])
normalized = preprocess(decoded)
return normalized
Here the only acceptable content_type is "application/x-image" but it is not allowed in ModelConfig. Any idea how to solve this?
Hi, We consider this as a feature request as here are the current supported content_type. https://github.com/aws/sagemaker-python-sdk/blob/master/src/sagemaker/clarify.py#L1170-L1176
I will consult our PM to put this on our roadmap. Thank you!
Hi, I have fine-tuned an image classification model using SageMaker jump start.
I have also deployed my model. This is my code for deploying my model:
I have only one img.png as input.
When I run my code I get this error: An error occurred (ModelError) when calling the InvokeEndpoint operation (reached max retries: 0): Received server error (500) from primary with message "{"error": "unsupported content type image/png"}"
I have been able to use this error for Batch Inference using png files, before, but it does not work with Clarify.