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
demandé il y a 4 ans802 vues
3 réponses
0
Réponse acceptée

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.

répondu il y a 4 ans
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?

répondu il y a 4 ans
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
répondu il y a 4 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions