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 年前檢視次數 777 次
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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南