Accessing SageMaker model after registering it

0

I can easily create and version a model using SM model registry: https://docs.aws.amazon.com/sagemaker/latest/dg/model-registry-version.html

After registering the model, it is also possible to access the metadata: https://docs.aws.amazon.com/sagemaker/latest/dg/model-registry-details.html but I do not understand how to programmatically access the internal of the model.

For example, I would like to manually inspect the weights of the last layer of my neural network. A model that I registered last week but that I do not have available on my machine anymore.

AWS
myname
asked 2 years ago2446 views
1 Answer
1
Accepted Answer

You can use describe_model_package to get the description of the specified model package.

In the response, in ModelDataUrl parameter you'll find the Amazon S3 path where the model artifacts, which result from model training, are stored. This path must point to a single gzip compressed tar archive (.tar.gz suffix).

You can download this file and unzip it. Inside will be the model files, as output of the training.

You can check this example notebook in which we show how to use Amazon SageMaker to train a Scikit-learn Random Forest model, register it in Model Registry, and run a Batch Transform Job.

profile pictureAWS
answered 2 years ago
  • This sounds great. Is there any documentation regarding the internal structure of the gzip file?

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