By using AWS re:Post, you agree to the Terms of Use

Accessing SageMaker model after registering it


I can easily create and version a model using SM model registry:

After registering the model, it is also possible to access the metadata: 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.

1 Answer
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 picture
answered 7 months 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