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
版权声明:本文标题:docker - No such file or directory: 'train' when executing a sagemaker pytorch estimator - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745613395a2159141.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论