Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError when trying to set model attributes #7

Open
estringfellow opened this issue Dec 29, 2020 · 1 comment
Open

AttributeError when trying to set model attributes #7

estringfellow opened this issue Dec 29, 2020 · 1 comment

Comments

@estringfellow
Copy link

Hello!

I'm trying to run through the "sagemaker_fraud_detection" notebook and I'm running into an issue when trying to set the 'content_type' and 'accept' attributes for the different predictors (Random Cut Forest, SMOTE).

Specifically, the commands with the issue:

rcf_predictor.content_type = 'text/csv'
rcf_predictor.serializer = csv_serializer
rcf_predictor.accept = 'application/json'
rcf_predictor.deserializer = json_deserializer

smote_predictor.content_type = 'text/csv'
smote_predictor.serializer = csv_serializer
smote_predictor.deserializer = None

Here is the error that I'm seeing:


AttributeError Traceback (most recent call last)
in
4
5 # Specify input and output formats.
----> 6 smote_predictor.content_type = 'text/csv'
7 smote_predictor.serializer = csv_serializer
8 smote_predictor.deserializer = None

AttributeError: can't set attribute

This issue seems to resolve itself with the random cut forest model but not with the SMOTE model.

Thanks in advance for any insights into this issue, and my apologies if I'm not doing something correctly.

Thanks!

image

@thvasilo
Copy link
Contributor

thvasilo commented Jan 6, 2021

Hello @estringfellow apologies for the late response!

The likely cause for this would be using SageMaker v2.0, the support for content_types were removed. The solution is designed to work for SageMaker v1.x, but we're working on v2.0 compatibility.

In terms of coming up with a solution for you, are you deploying the solution using the included CloudFormation template, or just using the notebook on an existing SageMaker notebook instance? When using the CloudFormation template you should be getting SageMaker version 1.72.
You can check the version using:

In [1]: import sagemaker

In [2]: sagemaker.__version__
Out[2]: '1.72.0'

Another option that makes it much easier to deploy and try the solution is to use it within the newly launched SageMaker Jumpstart that allows you to launch this and other SageMaker solutions with single click. You can see how to use Jumpstart within SageMaker Studio here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants