AWS Sagemaker-ClientError:数据下载失败

时间:2019-01-03 16:59:14

标签: python amazon-web-services tensorflow jupyter amazon-sagemaker

问题: 我正在尝试在Sagemaker中设置模型,但是在下载数据时失败。 有人知道我在做什么错吗?

我到目前为止所做的: 为了避免出现任何错误,我决定使用AWS教程: tensorflow_iris_dnn_classifier_using_estimators

我只做了两个更改:

  1. 我将数据集复制到了自己的S3实例。 ->我测试了是否可以访问/显示数据并且有效。
  2. 我编辑了指向新文件夹的路径。

这是AWS源代码: https://github.com/awslabs/amazon-sagemaker-examples/tree/master/sagemaker-python-sdk/tensorflow_iris_dnn_classifier_using_estimators

%%time
import boto3

# use the region-specific sample data bucket
region = boto3.Session().region_name
#train_data_location = 's3://sagemaker-sample-data-{}/tensorflow/iris'.format(region)
train_data_location = 's3://my-s3-bucket'

iris_estimator.fit(train_data_location)

这是我得到的错误:

/home/ec2-user/anaconda3/envs/tensorflow_p27/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in run_cell_magic(self, magic_name, line, cell)
   2115             magic_arg_s = self.var_expand(line, stack_depth)
   2116             with self.builtin_trap:
-> 2117                 result = fn(magic_arg_s, cell)
   2118             return result
   2119 

<decorator-gen-60> in time(self, line, cell, local_ns)

/home/ec2-user/anaconda3/envs/tensorflow_p27/lib/python2.7/site-packages/IPython/core/magic.pyc in <lambda>(f, *a, **k)
    186     # but it's overkill for just that one bit of state.
    187     def magic_deco(arg):
--> 188         call = lambda f, *a, **k: f(*a, **k)
    189 
    190         if callable(arg):

/home/ec2-user/anaconda3/envs/tensorflow_p27/lib/python2.7/site-packages/IPython/core/magics/execution.pyc in time(self, line, cell, local_ns)
   1191         else:
   1192             st = clock2()
-> 1193             exec(code, glob, local_ns)
   1194             end = clock2()
   1195             out = None

<timed exec> in <module>()

/home/ec2-user/anaconda3/envs/tensorflow_p27/lib/python2.7/site-packages/sagemaker/tensorflow/estimator.pyc in fit(self, inputs, wait, logs, job_name, run_tensorboard_locally)
    314                 tensorboard.join()
    315         else:
--> 316             fit_super()
    317 
    318     @classmethod

/home/ec2-user/anaconda3/envs/tensorflow_p27/lib/python2.7/site-packages/sagemaker/tensorflow/estimator.pyc in fit_super()
    293 
    294         def fit_super():
--> 295             super(TensorFlow, self).fit(inputs, wait, logs, job_name)
    296 
    297         if run_tensorboard_locally and wait is False:

/home/ec2-user/anaconda3/envs/tensorflow_p27/lib/python2.7/site-packages/sagemaker/estimator.pyc in fit(self, inputs, wait, logs, job_name)
    232         self.latest_training_job = _TrainingJob.start_new(self, inputs)
    233         if wait:
--> 234             self.latest_training_job.wait(logs=logs)
    235 
    236     def _compilation_job_name(self):

/home/ec2-user/anaconda3/envs/tensorflow_p27/lib/python2.7/site-packages/sagemaker/estimator.pyc in wait(self, logs)
    571     def wait(self, logs=True):
    572         if logs:
--> 573             self.sagemaker_session.logs_for_job(self.job_name, wait=True)
    574         else:
    575             self.sagemaker_session.wait_for_job(self.job_name)

/home/ec2-user/anaconda3/envs/tensorflow_p27/lib/python2.7/site-packages/sagemaker/session.pyc in logs_for_job(self, job_name, wait, poll)
   1126 
   1127         if wait:
-> 1128             self._check_job_status(job_name, description, 'TrainingJobStatus')
   1129             if dot:
   1130                 print()

/home/ec2-user/anaconda3/envs/tensorflow_p27/lib/python2.7/site-packages/sagemaker/session.pyc in _check_job_status(self, job, desc, status_key_name)
    826             reason = desc.get('FailureReason', '(No reason provided)')
    827             job_type = status_key_name.replace('JobStatus', ' job')
--> 828             raise ValueError('Error for {} {}: {} Reason: {}'.format(job_type, job, status, reason))
    829 
    830     def wait_for_endpoint(self, endpoint, poll=5):

ValueError: Error for Training job sagemaker-tensorflow-2019-01-03-16-32-16-435: Failed Reason: ClientError: Data download failed:S3 key: s3://my-s3-bucket//sagemaker-tensorflow-2019-01-03-14-02-39-959/source/sourcedir.tar.gz has an illegal char sub-sequence '//' in it

4 个答案:

答案 0 :(得分:1)

脚本期望'bucket'是bucket = Session()。default_bucket()或您自己的。您是否尝试过将存储桶设置为与个人存储桶相等?

答案 1 :(得分:0)

您收到的完整错误消息似乎是:

ClientError: Data download failed:S3 key: s3://my-s3-bucket//sagemaker-tensorflow-2019-01-03-14-02-39-959/source/sourcedir.tar.gz has an illegal char sub-sequence '//' in it

即使修复了钥匙,问题仍然存在吗?

答案 2 :(得分:0)

我有类似的经历。必须先更改输出名称,然后再更改,否则将给我双重'//'错误。所以就做“ my-s3-bucket”

答案 3 :(得分:0)

不。确保它只是您的输出名称,而不是存储区名称,所以我的名称是“ vanias bucket / results”,我将其更改为“ results”,它就可以了。祝你好运!