Created
January 11, 2019 20:27
-
-
Save vanpelt/293ecb6b6a414009e9b9bac6e4ecdcf6 to your computer and use it in GitHub Desktop.
Sagemaker Sweep Monitor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sagemaker | |
import wandb | |
tuner_name = "sagemaker-pytorch-190111-1056" | |
tuner = sagemaker.HyperparameterTuner.attach(tuner_name) | |
job_name = tuner.analytics().description()['TrainingJobDefinition']['StaticHyperParameters']['sagemaker_job_name'] | |
client = tuner.sagemaker_session.sagemaker_client | |
api = wandb.Api() | |
runs = api.runs("wandb/sm-pytorch-cifar", {"config.sagemaker_job_name": job_name}) | |
for run in runs: | |
if run.summary["_step"] > 100 and run.summary["Test Acc"] < 0.5: | |
client.stop_training_job(TrainingJobName=run.name.replace("algo-1", "")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment