Sazzad
Sazzad

Reputation: 853

Sagemaker Multi container endpoints error

I am trying to use the sagemaker multi-container option to deploy models. I am using the latest sagemaker version and PyTorch models. It looks like version mismatch from my point of view.

create_model_response = sm_client.create_model(
ModelName="multi-container3",
Containers=[pytorch_container, pytorch_container2],
InferenceExecutionConfig={"Mode": "Direct"},
ExecutionRoleArn=role,)

But I am getting this error. Any clue?

---------------------------------------------------------------------------
ParamValidationError                      Traceback (most recent call last)
<ipython-input-96-c6e1810e5d03> in <module>
      3     Containers=[pytorch_container, pytorch_container2],
      4     InferenceExecutionConfig={"Mode": "Direct"},
----> 5     ExecutionRoleArn=role,
      6 )

/opt/conda/lib/python3.7/site-packages/botocore/client.py in _api_call(self, *args, **kwargs)
    355         use_fips_endpoint = client.meta.config.use_fips_endpoint
    356         S3EndpointSetter(
--> 357             endpoint_resolver=self._endpoint_resolver,
    358             region=client.meta.region_name,
    359             s3_config=client.meta.config.s3,

/opt/conda/lib/python3.7/site-packages/botocore/client.py in _make_api_call(self, operation_name, api_params)
    647             metadata=resolved,
    648             signature_version=signature_version,
--> 649         )
    650 
    651     def _resolve_endpoint_variant_config_var(self, config_var):

/opt/conda/lib/python3.7/site-packages/botocore/client.py in _convert_to_request_dict(self, api_params, operation_model, context)
    695     ):
    696         if endpoint_url is None:
--> 697             # Expand the default hostname URI template.
    698             hostname = self.default_endpoint.format(
    699                 service=service_name, region=region_name

/opt/conda/lib/python3.7/site-packages/botocore/validate.py in serialize_to_request(self, parameters, operation_model)
    295         #   "type":"string",
    296         #   "min":1,
--> 297         #   "max":256
    298         #  }
    299         range_check(name, len(param), shape, 'invalid length', errors)

ParamValidationError: Parameter validation failed:
Unknown parameter in input: "InferenceExecutionConfig", must be one of: ModelName, PrimaryContainer, Containers, ExecutionRoleArn, Tags, VpcConfig, EnableNetworkIsolation

Thanks in advance

Upvotes: 0

Views: 250

Answers (1)

Raghu Ramesha
Raghu Ramesha

Reputation: 494

If you have similar framework, from what I see pytorch, I recommend using MME instead. MCE example to use multiple containers can be found here - https://github.com/aws-samples/sagemaker-hosting/blob/main/Advanced-Model-Deployment/Serial-Inference-Pipeline/Serial-Inference-Pipeline-with-Scikit-learn-and-Linear-Learner.ipynb

Upvotes: 1

Related Questions