content_type problem during testing of deployed inferencing endpoint #2567
Unanswered
xxl4tomxu98
asked this question in
Help
Replies: 1 comment
-
same here |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
class StringPredictor(Predictor):
def init(self, endpoint_name, sagemaker_session):
super(StringPredictor, self).init(endpoint_name, sagemaker_session, content_types='text/csv')
model = PyTorchModel(model_data=estimator.model_data,
role = role,
framework_version='1.8.1',
py_version='py36',
entry_point='predict.py',
source_dir='serve',
predictor_cls=StringPredictor)
The error message is:
ModelError: An error occurred (ModelError) when calling the InvokeEndpoint operation: Received server error (500) from model with message "Requested unsupported ContentType in content_type: application/octet-stream
Traceback (most recent call last):
File "/opt/conda/lib/python3.6/site-packages/sagemaker_inference/transformer.py", line 126, in transform
result = self._transform_fn(self._model, input_data, content_type, accept)
File "/opt/conda/lib/python3.6/site-packages/sagemaker_inference/transformer.py", line 215, in _default_transform_fn
data = self._input_fn(input_data, content_type)
File "/opt/ml/model/code/predict.py", line 54, in input_fn
raise Exception('Requested unsupported ContentType in content_type: ' + content_type)
Exception: Requested unsupported ContentType in content_type: application/octet-stream
". See https://us-east-1.console.aws.amazon.com/cloudwatch/home?region=us-east-1#logEventViewer:group=/aws/sagemaker/Endpoints/pytorch-inference-2021-08-07-19-02-59-975 in account 804604702169 for more information.
Beta Was this translation helpful? Give feedback.
All reactions