admin管理员组

文章数量:1025299

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.

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.

本文标签: dockerNo such file or directory 39train39 when executing a sagemaker pytorch estimatorStack Overflow