Error 403, Problem with importing image data in s3 to SageMaker Notebook

0

I am working with SageMaker Notebook and image data in S3 bucket with name s3://<BucketName>/train/<class0-4> and validate data in other dir.
I create an IAM Role and put previous specific bucket, in the notebook I load this bucket with:

s3_train = 's3://<BucketName>/train'
train_data = sagemaker.session.s3_input(s3_train, distribution='FullyReplicated', 
                        content_type='application/x-image', s3_data_type='S3Prefix')

The same for train lst file, validation data and validation lst data, after create data channels with this:

data_channels = {'train': train_data, 'validation': validation_data, 
                 'train_lst': train_data_lst, 'validation_lst': validation_data_lst}

After create a TensorFlow estimator, and finally in fit pass the data with this:

tf_estimator.fit(inputs=data_channels, logs=True)

And return this menssage error:
An error occurred (403) when calling the HeadObject operation: Forbidden

Inntech
已提问 4 年前812 查看次数
3 回答
0
已接受的回答

An empty bucket policy is fine. You should only make your objects public if you want everyone in the world to have access.

If you’re using a SageMaker notebook server, then when you created it you would have created (or used an existing) IAM role for it. You should check to see it’s S3 permissions, and make sure that it has access to the bucket in question.

Hope that helps.

已回答 4 年前
0

Looks like an issue with a policy attached to your role. Do you want to paste it in here so we can take a look?

已回答 4 年前
0

The bucket policy its empty, change the bucket to public access, but the files aren't public, think that the directories are public and files not. What suggest put in bucket policy??

Inntech
已回答 4 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则