【问题标题】:Training Job in Sagemaker gives error in locating file in S3 to docker image pathSagemaker 中的培训作业在将 S3 中的文件定位到 docker 映像路径时出错
【发布时间】:2020-05-24 06:11:49
【问题描述】:

我正在尝试使用 scikit_bring_your_own/container/decision_trees/train mode,在 AWS CLI 中运行,我没有遇到任何问题。尝试在创建 Sagemaker 训练作业中进行复制,在将数据从 S3 加载到 docker 映像路径时遇到问题。

在 CLI 命令中,我们使用指定输入需要引用的docker run -v $(pwd)/test_dir:/opt/ml --rm ${image} train

在训练工作中,提到了模型工件的 S3 存储桶位置和输出路径。

Error entered in the exception as in train - "container/decision_trees/train"
raise ValueError(('There are no files in {}.\n' + 
'This usually indicates that the channel ({}) was incorrectly specified,\n'  + 
'the data specification in S3 was incorrectly specified or the role specified\n' +
'does not have permission to access the data.').format(training_path, channel_name))

Traceback (most recent call last):
File "/opt/program/train", line 55, in train
'does not have permission to access the data.').format(training_path, channel_name)) 

所以不明白是否需要进行任何调整或缺少任何访问权限。

请帮忙

【问题讨论】:

    标签: amazon-sagemaker


    【解决方案1】:

    如果您像这样在 CreateTrainingJob API 中设置 InputDataConfig

    "InputDataConfig": [ 
      { 
         "ChannelName": "train",
         "DataSource": { 
            "S3DataSource": { 
               "S3DataDistributionType": "FullyReplicated",
               "S3DataType": "S3Prefix",
               "S3Uri": "s3://<bucket>/a.csv"
            }
         },
         "InputMode": "File",
      },
      { 
         "ChannelName": "eval",
         "DataSource": { 
            "S3DataSource": { 
               "S3DataDistributionType": "FullyReplicated",
               "S3DataType": "S3Prefix",
               "S3Uri": "s3://<bucket>/b.csv"
            }
         },
         "InputMode": "File",
      }
    ]
    

    SageMaker 将上面指定的数据从 S3 下载到 Docker 容器中的 /opt/ml/input/data/channel_name 目录。在这种情况下,算法容器应该能够在

    下找到输入数据
    /opt/ml/input/data/train/a.csv
    /opt/ml/input/data/eval/b.csv
    

    您可以在https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms-training-algo.html找到更多详细信息

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-11-18
      • 1970-01-01
      • 2017-07-25
      • 2020-09-12
      • 1970-01-01
      • 1970-01-01
      • 2018-10-04
      • 1970-01-01
      相关资源
      最近更新 更多