'Getting model metadata from SageMaker model endpoint

I have a TF model object deployed to SageMaker endpoint, and it's working fine when I invoke it to make a prediction. On its own, the model object itself contains key attributes that is accessible if I open it with h5py.File() like this:

with h5py.File(model_path2, 'r') as f:
    labels = [n.decode("ascii", "ignore") for n in f['labels']]
    img_norm_vec = np.array(f['norm_vector'])

My question is, can I access the metadata attributes from a SM endpoint? I searched through the SM documentation and didn't see anything related to this.



Solution 1:[1]

Sorry for the delayed response. SM endpoint doesn't provide a way to extract model metadata attributes at this time. Following SDK doc link outlines the calls you can make against an Endpoint: https://sagemaker.readthedocs.io/en/stable/api/inference/predictors.html.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1