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?

posta un anno fa251 visualizzazioni
1 Risposta
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
TECNICO DI SUPPORTO
con risposta un anno fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande