0

I am trying to invoke a multi-model endpoint in AWS Sagemaker and I am getting a ModelError -ModelError: An error occurred (ModelError) when calling the InvokeEndpoint operation: Received server error (500) from model with message "invalid literal for int() with base 10: 'Iris-virginica'". I have used Sklearn model with IRIS dataset and Decision Tree Algorithm to predict the output.

import boto3
import json

runtime_client = boto3.client('sagemaker')
content_type = "application/json"
request_body = {"Input": [[1.2,0.5, 1.7, 2.6, 2.7,1.0]]}
data = json.loads(json.dumps(request_body))
payload = json.dumps(data)
endpoint_name = "sklearn-endpoint"
print("payload ",type(payload))
response = runtime_client.invoke_endpoint(
    EndpointName=endpoint_name,
    ContentType=content_type,
    TargetModel="iris.tar.gz",
    Body=payload)
Mrunall Veer
  • 101
  • 2
  • 3
  • 12

0 Answers0