Now, let's deploy the trained object2vec model. The SageMaker SDK offers methods so that we can seamlessly deploy trained models:
- First, we will create a model from the training job using the create_model() method of the SageMaker Estimator object, as shown in the following code:
from sagemaker.predictor import json_serializer, json_deserializer# create a model using the trained algorithmregression_model = regressor.create_model(serializer=json_serializer, deserializer=json_deserializer,content_type='application/json')
To the create_model() method, we passed the type of serializers and deserializers to be used for the payload at the time of inference.
- Once the model has been created, ...