[英]How to access sagemaker model registry metrics from within the endpoint
[英]how to call sagemaker endpoint from another server
我尝试调用 aws sagemaker 端点。 但我不使用 lambda function。只是,我想访问端点 ARN,URL。
如果不可能的方法,我想知道 lambda function
我的端点基于 keras model。我不知道 json.dumps
import json
import boto3
client = boto3.client('runtime.sagemaker')
import numpy as np
test = np.zeros((1, 1, 4325))
test[0][0][1] = 1
data = {"instances": test.tolist()}
response = client.invoke_endpoint(EndpointName=endpoint_name,
Body=json.dumps(data))
response_body = response['Body']
print(response_body.read())
您的问题有点令人困惑。 我了解您想在Sagemaker外部调用已部署的端点,您可以按以下所示执行此操作,例如call-sagemaker-endpoint-using-lambda-function
您也可以像这样使用 awscurl 调用它:
awscurl --profile aws-profile -XPOST -H 'Content-Type: application/json' --data @input_file_name https://runtime.sagemaker.us-east-1.amazonaws.com/endpoints/your-endpoint-name/invocations --service sagemaker
您可能还想尝试使用环境变量 export AWS_PROFILE=aws-profile; 在通话之前确保您没有设置其他内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.