Created
July 9, 2020 06:05
-
-
Save ctodd/853c28cb1ff1b34ff3acf97e1f882b35 to your computer and use it in GitHub Desktop.
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 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