You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Create Sklearn model.tar.gz in one sagemaker, use the model in another sagemaker without using endpoint #1854
I am creating model.tar.gz for random forest classifier in sagemaker using sklearn based on sagemaker sklearn end 2 end example
my goal is to use the saved model in one sagemaker environment to deploy in another sagemaker environment without doing estimator or training again i just need to do batch transform
can you please point any documentation on loading the model and doing batch
Hi @radhakrishnang, if you have a pre-trained model, assuming that you have the S3 uri of the model artifact and your SageMaker role has access to the object, you can do the following to deploy the model to an endpoint:
Hi @radhakrishnang, if you have a pre-trained model, assuming that you have the S3 uri of the model artifact and your SageMaker role has access to the object, you can do the following to deploy the model to an endpoint:
model = SKLearnModel(model_data=<your pre-trained model location in S3>,
role=<your SageMaker role>,
entrypoint=<your inference script>,
... # other optional params)
model.deploy(initial_instance_count=<instance count>,
instance_type=<chosen instance type>,
... # other optional params)
As for the batch transform, after your endpoint is in service, you can proceed batch transforming as normal.
Ni hao @ChuyangDeng,
I want to use model.tar.gz created from already trained model in sagemaker to be directly deployed in another sagemaker environment for batch transform without training again or having endpoint creation ... is it feasible?
Activity
chuyang-deng commentedon Sep 1, 2020
Hi @radhakrishnang, if you have a pre-trained model, assuming that you have the S3 uri of the model artifact and your SageMaker role has access to the object, you can do the following to deploy the model to an endpoint:
https://github.com/aws/sagemaker-python-sdk/blob/master/src/sagemaker/sklearn/model.py#L53
https://github.com/aws/sagemaker-python-sdk/blob/master/src/sagemaker/model.py#L406
As for the batch transform, after your endpoint is in service, you can proceed batch transforming as normal.
radhakrishnang commentedon Sep 2, 2020
Ni hao @ChuyangDeng,
I want to use model.tar.gz created from already trained model in sagemaker to be directly deployed in another sagemaker environment for batch transform without training again or having endpoint creation ... is it feasible?
Xiexie