3 réponses
- Le plus récent
- Le plus de votes
- La plupart des commentaires
0
thanks for using SageMaker! you're on the right path - you'll need to pass in an argument for "predictor_cls" when creating your Model instance in order for a predictor object to be returned after calling deploy(), e.g.
from sagemaker.model import Model
from sagemaker.predictor import RealTimePredictor, csv_serializer, csv_deserializer
class Predictor(RealTimePredictor):
def __init__(self, endpoint_name, sagemaker_session=None):
super(Predictor, self).__init__(
endpoint_name, sagemaker_session, csv_serializer, csv_deserializer
)
trainedmodel = Model(..., predictor_cls=Predictor)
xgb_predictor = trainedmodel.deploy(...)
xgb_predictor.predict(...)
API reference:
- https://sagemaker.readthedocs.io/en/stable/model.html
- https://sagemaker.readthedocs.io/en/stable/predictors.html
hope that helps!
répondu il y a 5 ans
0
Any special reason for using csv serializer/deserializer? In my case I reload a model to analyze videos (frames in numpy array actually). What serializer/deserializer should I use?
Actually, any doc regarding how to properly use the argument predictor_cls would be highly appreicated.
répondu il y a 3 ans
Contenus pertinents
- demandé il y a 4 mois
- demandé il y a un an
- demandé il y a 6 mois
- AWS OFFICIELA mis à jour il y a 8 mois
- AWS OFFICIELA mis à jour il y a 2 ans