Closed PacktAsh closed 3 years ago
@PacktAsh the link you provided points to your notebook instance. You need to provide the link of the notebook published on github
Let me know if this will suffice or I need to actually output a nb and upload it to git. Thanks!
My container -> Blazing Text Model
container=sagemaker.amazon.amazon_estimator.get_image_uri(region_name, "blazingtext", "latest")
My estimator:
bt = sagemaker.estimator.Estimator(container,
role,
instance_count=1,
instance_type='ml.m5.large',
input_mode='File',
output_path=s3_output_location)
bt.set_hyperparameters(mode='supervised')
Model tuning: bt.fit(inputs=s3_channels)
Deploying to container: customer_entity = bt.deploy(initial_instance_count=1, instance_type='ml.t2.medium')
Defining the payload: payload = {"instances": ["sears roebuck 4692346789", "jc penny 8185551212 jspenn@jcp@com"], "configuration": {"k":2}}
Invoking the model: customer_entity.content_type = 'application/json' response = customer_entity.predict(json.dumps(payload))
Error:
AttributeError Traceback (most recent call last)
Bug report is intended to be used a place to report bugs in the notebooks we provide as examples. I would suggest you to use stackoverflow to handle your specific use case
This would be the aws notebook I am following. The bug is under Hosting/Inference.
Sorry I misunderstood your question.
Nice. thanks for the reporting. take a look at this PR https://github.com/aws/amazon-sagemaker-examples/pull/2051
Fixed in #2051
Link to the notebook https://textclassification-az3m.notebook.us-east-2.sagemaker.aws/notebooks/blazingtext-v2.ipynb
Describe the bug Using blazing text model, when making predictions on model end-point
payload= {"instances": ["johhny rocketts", "steak & shake"], "configuration": {"k":2}} customer_entity.content_type = 'application/json' response = customer_entity.predict(json.dumps(payload))
Getting the following error: AttributeError: can't set attribute
To Reproduce deploy blazing text model to container provide payload as shown; define attribute as json make the model call