Amazon SageMaker - 预构建容器,部署终端节点失败。“No such file or directory: 'serve'””。

0

【以下的问题经过翻译处理】 我试图通过扩展预构建镜像来部署SageMaker推理端点。然而,它失败了,错误为“FileNotFoundError:[Errno 2] No such file or directory: 'serve'”。

我的Dockerfile:

ARG REGION=us-west-2

SageMaker PyTorch image

FROM 763104351884.dkr.ecr.$REGION.amazonaws.com/pytorch-inference:1.12.1-gpu-py38-cu116-ubuntu20.04-ec2

RUN apt-get update

ENV PATH="/opt/ml/code:${PATH}"

#此环境变量用于SageMaker PyTorch容器确定我们的用户代码目录。 ENV SAGEMAKER_SUBMIT_DIRECTORY /opt/ml/code

#/ opt / ml及其所有子目录由SageMaker使用,使用/code子目录存储用户代码。 COPY inference.py /opt/ml/code/inference.py

#将inference.py定义为脚本入口点 ENV SAGEMAKER_PROGRAM inference.py

/aws/sagemaker/Endpoints/mytestEndpoint的CloudWatch日志:

2022-09-30T04:47:09.178-07:00 Traceback (most recent call last): File "/usr/local/bin/dockerd-entrypoint.py", line 20, in <module> subprocess.check_call(shlex.split(' '.join(sys.argv[1:]))) File "/opt/conda/lib/python3.8/subprocess.py", line 359, in check_call retcode = call(popenargs, kwargs) File "/opt/conda/lib/python3.8/subprocess.py", line 340, in call *with Popen(*popenargs, kwargs) as p: File "/opt/conda/lib/python3.8/subprocess.py", line 858, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/opt/conda/lib/python3.8/subprocess.py", line 1704, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) Traceback (most recent call last): File "/usr/local/bin/dockerd-entrypoint.py", line 20, in <module> subprocess.check_call(shlex

profile picture
专家
已提问 8 个月前88 查看次数
1 回答
0

【以下的回答经过翻译处理】 应该使用Sagemaker镜像

763104351884.dkr.ecr.$REGION.amazonaws.com/pytorch-inference:1.12.1-gpu-py38-cu116-ubuntu20.04-sagemaker

而不是EC2

763104351884.dkr.ecr.$REGION.amazonaws.com/pytorch-inference:1.12.1-gpu-py38-cu116-ubuntu20.04-ec2

profile picture
专家
已回答 8 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则