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?

질문됨 일 년 전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
지원 엔지니어
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠