aws-samples/aws-modern-application-workshop

Module 7 - Training job

Opened this issue · 3 comments

I get the following error when executing the Jupyter notebook:

ClientError: An error occurred (AccessDeniedException) when calling the CreateTrainingJob operation: User: arn:aws:sts::395190607265:assumed-role/MysfitsNotbookRole/SageMaker is not authorized to perform: sagemaker:CreateTrainingJob on resource: arn:aws:sagemaker:us-east-1:395190607265:training-job/knn-2021-04-20-19-44-27-275 with an explicit deny

I am using a starter account for my graduate cloud course. Sagemaker is allowed, and the training instance type seems allowed as well.

When executing the notebook on my 'full' account, I can train the model, but i receive an attribute error when setting up the endpoint.

It turns out that I need to comment out the following line in cell 8 (setting up the endpoint)

knn_predictor.content_type = 'text/csv'

I get many warnings messages about out-dated versions.

yes my fix was to :
comment out
#knn_predictor.content_type = 'text/csv'

change this line :
predictor.predict(batch)
to ...
predictor.predict(batch, initial_args={'ContentType': 'text/csv'})