最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

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

matteradmin8PV0评论

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.

Post a comment

comment list (0)

  1. No comments so far