除了亞馬遜官網(wǎng)的文章
https://docs.aws.amazon.com/zh_cn/sagemaker/latest/dg/ex1-model-deployment.html
https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/machinelearning-pattern-list.html,還有這些:
Pytorch學(xué)習(xí)
https://sagemaker.readthedocs.io/en/stable/frameworks/pytorch/using_pytorch.html
推理容器
https://docs.aws.amazon.com/sagemaker/latest/dg/adapt-inference-container.html
https://docs.aws.amazon.com/sagemaker/latest/dg/prebuilt-containers-extend.html
ML 模型容器
https://github.com/aws/deep-learning-containers/tree/master/pytorch
異步推理
https://docs.aws.amazon.com/sagemaker/latest/dg/async-inference.html
在線部署AWS服務(wù)的話,還需要了解存儲/權(quán)限等其他基礎(chǔ)設(shè)施服務(wù):
存儲
https://docs.aws.amazon.com/AmazonS3/latest/userguide/add-bucket-policy.html
權(quán)限
https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-service.html#roles-creatingrole-service-console
鏡像
https://github.com/aws/deep-learning-containers/blob/master/available_images.md
自用賬號別忘了注銷服務(wù):永久關(guān)閉亞馬遜云AmazonAWS并解除信用卡綁定防止被扣費(fèi)
權(quán)限問題
使用時(shí)有遇到在notebook里無法使用S3的文件,首先,bucket的根目錄的名字需要以"sagemaker-"開頭。見:Unable to access data from S3 bucket to jupyter notebook of aws sagemaker
如果還不行的話,就設(shè)置一下相關(guān)的權(quán)限,對應(yīng)文章:
https://docs.aws.amazon.com/sagemaker/latest/dg/data-wrangler-security.html
Block public access (bucket settings) 也設(shè)置成off, 以s3的bucket配置:
https://us-east-1.console.aws.amazon.com/iamv2/home?region=us-east-1#/users/details/xxx?section=permissions
IAM->Users->xxx的permissions的tab下增加權(quán)限
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"s3:ListAccessPointsForObjectLambda",
"s3:GetAccessPoint",
"s3:PutAccountPublicAccessBlock",
"s3:ListAccessPoints",
"s3:CreateStorageLensGroup",
"s3:ListJobs",
"s3:PutStorageLensConfiguration",
"s3:ListMultiRegionAccessPoints",
"s3:ListStorageLensGroups",
"s3:ListStorageLensConfigurations",
"s3:GetAccountPublicAccessBlock",
"s3:ListAllMyBuckets",
"s3:ListAccessGrantsInstances",
"s3:PutAccessPointPublicAccessBlock",
"s3:CreateJob"
],
"Resource": "*"
},
{
"Sid": "VisualEditor1",
"Effect": "Allow",
"Action": "s3:*",
"Resource": "arn:aws:s3:::*"
}
]
}
https://us-east-1.console.aws.amazon.com/iamv2/home?region=us-east-1#/policies/details/arn%3Aaws%3Aiam%3A%3A931637612418%3Apolicy%2Fservice-role%2FAmazonSageMaker-ExecutionPolicy-xxx/edit/v1/
IAM
Policies
AmazonSageMaker-ExecutionPolicy-20250416T160340
Edit policy
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"s3:ListBucket"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::SageMaker"
]
},
{
"Action": [
"s3:GetObject",
"s3:PutObject",
"s3:DeleteObject"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::SageMaker/*"
]
}
]
}