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년 전802회 조회
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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠