how to use sagemaker api/sdk to query training metadata?

0

I am creating a sagemaker estimator and running it in my notebook , also i can run this code as training step and extend it as a pipeline. I want to display the full paths (s3 uri) where , this training step dumped the model output, checkpoints e.t.c.

i'm thinking something like , step_train .modeloutputpath that i execute in my notebook cell and it returns the path of where it saved the model. i will look through the documentation to see what is possible , but trying to see , if there is a simple way to get paths or other metadata easily , directly from the notebook.

from sagemaker.xgboost.estimator import XGBoost

xgb_estimator = XGBoost(
    entry_point="abalone.py",
    source_dir="code",
    hyperparameters=hyperparameters,
    role=role,
    instance_count=1,
    instance_type="ml.m5.2xlarge",
    framework_version="1.0-1",
)

step_args = xgb_estimator.fit(
    inputs={
        "train": TrainingInput(
            s3_data=step_process.properties.ProcessingOutputConfig.Outputs[
                "train"
            ].S3Output.S3Uri,
            content_type="text/csv"
        ),
        "validation": TrainingInput(
            s3_data=step_process.properties.ProcessingOutputConfig.Outputs[
                "validation"
            ].S3Output.S3Uri,
            content_type="text/csv"
        )
    }
)

step_train = TrainingStep(
    name="TrainAbaloneModel",
    step_args=step_args,
)
asked a year ago190 views
1 Answer
0

You can use API DescribeTraningJob or AWS CLI query aws sagemaker describe-training-job --training-job-name <xxxxx> to query the training job metadata

https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeTrainingJob.html https://docs.aws.amazon.com/cli/latest/reference/sagemaker/describe-training-job.html

AWS
sqavi
answered a year ago

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