AWS Sagemaker英语2德语翻译考试

2024-09-30 14:19:52 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在Sagemaker中运行一个关于英语和德语翻译的示例笔记本,但每当我运行以下代码块时,就会出现错误:

    %%time

sage = boto3.client('sagemaker')

if not use_pretrained_model:
    print("False")
    info = sage.describe_training_job(TrainingJobName=job_name)
    model_name=job_name
    model_data = info['ModelArtifacts']['S3ModelArtifacts']
#     model_data = info['InputDataConfig'][0]['DataSource']['S3DataSource']['S3Uri']

print(model_name)
print(model_data)

primary_container = {
    'Image': container,
    'ModelDataUrl': model_data
}

create_model_response = sage.create_model(
    ModelName = model_name,
    ExecutionRoleArn = role,
    PrimaryContainer = primary_container)

print(create_model_response['ModelArn'])

错误是:

KeyError: 'ModelArtifacts'

显然,关键的模型构件已经不存在了。他们改了吗?用什么代替


Tags: nameinfo示例datamodelresponsecontainer错误