Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
updated code
Source Link
nad
  • 2.9k
  • 13
  • 64
  • 105

I have an image that I upload to s3 in mybucket. Suppose my s3 endpoint for this data is s3://mybucket/imgname

Now I also have a model deployed in SageMaker at sagemaker-model-endpoint

I looked into examples of how to invoke this SageMaker endpoint from a boto client here but I am not sure how to specify the s3 path s3://mybucket/imgname in the invoke_endpoint call.

client = botoboto3.client("runtime.sagemaker", region_name = 's3.us-east-2.amazonaws.com') client.invoke_endpoint( EndpointName=sagemaker-model-endpoint Body=payload, ContentType='image/jpg', Accept='Accept') 

What should be the payload in this case? Where do I specify the s3 url?

I have an image that I upload to s3 in mybucket. Suppose my s3 endpoint for this data is s3://mybucket/imgname

Now I also have a model deployed in SageMaker at sagemaker-model-endpoint

I looked into examples of how to invoke this SageMaker endpoint from a boto client here but I am not sure how to specify the s3 path s3://mybucket/imgname in the invoke_endpoint call.

client = boto.client("runtime.sagemaker", region_name = 's3.us-east-2.amazonaws.com') client.invoke_endpoint( EndpointName=sagemaker-model-endpoint Body=payload, ContentType='image/jpg', Accept='Accept') 

What should be the payload in this case? Where do I specify the s3 url?

I have an image that I upload to s3 in mybucket. Suppose my s3 endpoint for this data is s3://mybucket/imgname

Now I also have a model deployed in SageMaker at sagemaker-model-endpoint

I looked into examples of how to invoke this SageMaker endpoint from a boto client here but I am not sure how to specify the s3 path s3://mybucket/imgname in the invoke_endpoint call.

client = boto3.client("runtime.sagemaker", region_name = 's3.us-east-2.amazonaws.com') client.invoke_endpoint( EndpointName=sagemaker-model-endpoint Body=payload, ContentType='image/jpg', Accept='Accept') 

What should be the payload in this case? Where do I specify the s3 url?

Source Link
nad
  • 2.9k
  • 13
  • 64
  • 105

Invoking SageMaker endpoint with data payload in S3 from a python boto client

I have an image that I upload to s3 in mybucket. Suppose my s3 endpoint for this data is s3://mybucket/imgname

Now I also have a model deployed in SageMaker at sagemaker-model-endpoint

I looked into examples of how to invoke this SageMaker endpoint from a boto client here but I am not sure how to specify the s3 path s3://mybucket/imgname in the invoke_endpoint call.

client = boto.client("runtime.sagemaker", region_name = 's3.us-east-2.amazonaws.com') client.invoke_endpoint( EndpointName=sagemaker-model-endpoint Body=payload, ContentType='image/jpg', Accept='Accept') 

What should be the payload in this case? Where do I specify the s3 url?