Attempting to use Sagemaker to generate pt file, I am given params file.

1

When running the tutorial code at https://sagemaker-examples.readthedocs.io/en/latest/introduction_to_amazon_algorithms/semantic_segmentation_pascalvoc/semantic_segmentation_pascalvoc.html the model.tar.gz file that is generated contains three files:

hyperparams.json

model_algo-1

model_best.params

I assume that model_best.params is the model, but I have no familiarity with params files and am attempting to load the model locally for inference with PyTorch. I have no intentions of running inference in AWS, I intend to run inference locally on an NVIDIA Jetson device. Is there any way to make AWS Sagemaker generate a .pt file? Is there any way to convert a .params file to a .pt file? Is there any way for PyTorch to natively import a .params file? I am very new to AWS and am desperately attempting to train a deeplab image segmentation model that can be used for local PyTorch inference. Is this possible with AWS?

asked a year ago238 views
1 Answer
0

Hi,
Yes the model_best.params is the model. As described in the AWS documentation, the semantic segmentation algorithm used by SageMaker is buit using the MXNet Gluon framework and the Gluon CV toolkit so I would recommend that you try using MXNet instead of pytorch to run inference locally as converting the MXNet model into a pytorch model can be very tedious.

However if you prefer to stick with pytorch then I would suggest you use something like MMdnn and refer to this example for converting your model from MXNet to pytorch. Your results may vary when changing frameworks and MMdnn is not quite user friendly (you will need to rename your .params and .json file to be in a similar format as the example otherwise MMdnn will throw errors at you).

AWS
SUPPORT ENGINEER
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions