I am trying to invoke an Amazon Sagemaker Endpoint from a local python notebook. This is the code I am using.
import boto3
aws_access_key_id = '...............'
aws_secret_access_key = '................'
tkn = '..........'
region_name = '............'
amz = boto3.client('sagemaker-runtime',
aws_access_key_id=aws_access_key_id,
aws_secret_access_key=aws_secret_access_key,
aws_session_token=tkn,
region_name=region_name)
response = amz.invoke_endpoint(
EndpointName='mymodel',
Body=b'bytes'
)
However, this doesn't work. Do I have to specify something else in Body ?