Skip to content

Instantly share code, notes, and snippets.

@ctodd
Created July 9, 2020 06:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ctodd/853c28cb1ff1b34ff3acf97e1f882b35 to your computer and use it in GitHub Desktop.
Save ctodd/853c28cb1ff1b34ff3acf97e1f882b35 to your computer and use it in GitHub Desktop.
import time
timestamp = time.strftime('-%Y-%m-%d-%H-%M-%S', time.gmtime())
model_name = training_job_name + '-model' + timestamp
training_image = training_info['AlgorithmSpecification']['TrainingImage']
model_data = training_info['ModelArtifacts']['S3ModelArtifacts']
primary_container = {
'Image': training_image,
'ModelDataUrl': model_data,
}
from sagemaker import get_execution_role
role = get_execution_role()
create_model_response = client.create_model(
ModelName = model_name,
ExecutionRoleArn = role,
PrimaryContainer = primary_container)
print(create_model_response['ModelArn'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment