简体   繁体   中英

Deploy trained Sagemaker Mxnet object detection model locally?

I have trained an object detection model on AWS Sagemaker. I want to use this model locally in my machine. I downloaded this model which consist of 3 files hyperparams.json, model-symbol.json, and model-0000.params. I have seen plenty of tutorials to deploy object classification model locally but didn't get any for object detection.

There are different possibilities:

  • You can install SageMaker Python SDK locally on your machine and use SageMaker to train and deploy your model locally Therefore you need to indicate in the MXNet Estimator train_instance_type='local'. SageMaker will then pull in the data from S3 into you local machine and train the model there. mxnet_estimator.deploy will then deploy the model locally. You can find a detailed description here
  • You can use MXNet's Model Server. You need to convert your model files into model archive (.mar) You can deploy it in the following way: mxnet-model-server --models mymodel=mymodel.mar

As NRauschmayr mentioned it can be convenient to use SageMaker's Python SDK local mode feature if you are also using it to train on SageMaker. One slight correction is that you would be setting the instance_type of the predictor to 'local' since you are interested in local deployment. You can read more about local mode here: https://sagemaker.readthedocs.io/en/stable/overview.html#local-mode

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM