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?

已提問 1 年前檢視次數 251 次
1 個回答
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
支援工程師
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南