最新的 aws xgb 图像不支持 reg:

latest aws xgb image does not support reg:

以下代码片段的灵感来自 this

hyperparameters = {
        "max_depth":"5",
        "eta":"0.2",
        "gamma":"4",
        "min_child_weight":"6",
        "subsample":"0.7",
        "objective":"reg:squarederror",
        "num_round":"10"}

output_path = 's3://{}/{}/output'.format(s3_bucket_name, s3_prefix)

estimator = sagemaker.estimator.Estimator(image_uri=sagemaker.image_uris.retrieve("xgboost", region_name, "1.2-2"), 
                                          hyperparameters=hyperparameters,
                                          role=role,
                                          instance_count=1, 
                                          instance_type='ml.m5.2xlarge', 
                                          volume_size=1, # 1 GB 
                                          output_path=output_path)

estimator.fit({'train': s3_input_train, 'validation': s3_input_val})

它工作正常。我试图使用:

training_image_name = image_uris.retrieve(framework='xgboost', region=region_name, version='latest')

而不是:

sagemaker.image_uris.retrieve("xgboost", region_name, "1.2-2")

(我相信)获取最新的训练图像,但 reg:squarederror 不受支持?我获取最新图像名称的代码是否不正确?

根据文档不建议使用“最新”(见注释):https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-algo-docker-registry-paths.html

使用特定版本,因为它们更稳定。