aws / aws/amazon-sagemaker-examples

ClientError for BatchTransform with BlazingText Classifier

Open
#1,275 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
11k
Forks
7k
Avg merge
8h 29m
Merged PRs (30d)
8

Description

I have successfully created the blazing text classifier according to the example code provided in aws-sagemaker examples. The model is deployed successfully and make predictions for new custom test cases. But I get the following error while attempting to perform BatchTransform with a file stored in S3.
My code sample for processing TestFile and training file is the same using nltk tokenizer. And after processing I am saving the test file for batch transform with the syntax:
"source": "source_sentence_0"
"source"; "source_sentence_1"

**CODE for batch transform:**
`testfile_location = 's3://{}/{}/batch/{}'.format(bucket, prefix, batch_file)
bt_transformer = bt_model.transformer(1, 'ml.m4.xlarge', strategy='SingleRecord', accept = "application/jsonlines", output_path = s3_output_location)
bt_transformer.transform(testfile_location, split_type='Line', content_type = "application/jsonlines")
bt_transformer.wait()`

Error message received is:
Customer Error: Unable to decode payload: Incorrect data format. (caused by ValueError)**

Training Sample:
__label__0 xperia xa ultra test results - sony mobile ( global english )
__label__0 san esteban de gormaz english tutors

File used for Batch Transform:
{"source": "fifiminoucha3 - Stardoll | English"}
{"source": "How do you write -9804 in English spelling ?"}

Contributor guide

Open the contributing guide

Research direction

Start with the batch-transform code and the training and batch input samples shown in the issue, then compare them with the referenced aws-sagemaker examples. Reproduce the `Unable to decode payload` error using the S3 test file; done means BatchTransform accepts the JSON Lines input and produces predictions.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python
Domain
cloud, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.