docker - No such file or directory: 'train' when executing a sagemaker pytorch estimator - Stack Overflow

Running this command, I get the following error.from sagemaker.estimator import Estimatorfrom sagemak

Running this command, I get the following error.

from sagemaker.estimator import Estimator
from sagemaker import get_execution_role
import sagemaker
role=get_execution_role()

hyperparameters = {
    'num_classes': 133,
    'epochs': 1
}


estimator=Estimator(
    image_uri='docker-image',
    role=role,
    instance_count=1,
    instance_type='local',
    hyperparameters=hyperparameters
)

estimator.fit(inputs="file://data/train", logs=True)

There is data in the file://data/train path.

Here is my Dockerfile

# SageMaker PyTorch image
FROM 763104351884.dkr.ecr.us-east-1.amazonaws/pytorch-inference:2.5.1-cpu-py311-ubuntu22.04-sagemaker

# Set the environment variable to include your code in the PATH
ENV PATH="/opt/ml/code:${PATH}"

# This environment variable is used by the SageMaker PyTorch container
# to determine our user code directory
ENV SAGEMAKER_SUBMIT_DIRECTORY /opt/ml/code

# Copy the user code to the container
COPY train.py /opt/ml/code/train.py

# Set the working directory
WORKDIR /opt/ml/code

# Define the entry point for the container
CMD ["python", "train.py"]

I am trying to figure out why the process is trying to find this train file and can't find it.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745613396a4636086.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信