aws-samples / aws-modern-application-workshop

A tutorial for developers that want to learn about how to build modern applications on top of AWS. You will build a sample website that leverages infrastructure as code, containers, serverless code functions, CI/CD, and more.
Apache License 2.0
1.46k stars 832 forks source link

Module 7 - Training job #253

Open kristofrk opened 3 years ago

kristofrk commented 3 years ago

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.

kristofrk commented 3 years ago

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

kristofrk commented 3 years ago

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.

em-xqm commented 3 years ago

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'})