You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

AWS SageMaker训练模型报UnexpectedStatusException错误求助

SageMaker XGBoost训练报错KeyError: 'silent'的解决办法

这个错误和你设置的区域ap-northeast-2无关,问题出在SageMaker XGBoost容器的版本更新上——新版容器已经移除了silent这个超参数,但你参考的官网教程还没同步更新代码。

解决步骤:

  1. 找到你初始化XGBoost estimator时的超参数配置,删除其中的'silent': 1(或对应值)这一行。
  2. 若需要控制训练日志的输出级别,用verbosity参数替代silent:
    • verbosity=0:静默模式(对应原silent=1的效果)
    • verbosity=1:仅输出警告信息
    • verbosity=2:输出详细训练日志(对应原silent=0的效果)

示例修改:
原初始化代码(含过时参数):

xgb = sagemaker.estimator.Estimator(
    image_uri=xgb_image_uri,
    role=role,
    instance_count=1,
    instance_type='ml.m5.xlarge',
    hyperparameters={
        'silent': 1,
        'objective': 'binary:logistic',
        'num_round': 100
    }
)

修改后代码:

xgb = sagemaker.estimator.Estimator(
    image_uri=xgb_image_uri,
    role=role,
    instance_count=1,
    instance_type='ml.m5.xlarge',
    hyperparameters={
        'verbosity': 0,
        'objective': 'binary:logistic',
        'num_round': 100
    }
)

修改后重新执行xgb.fit({'train': s3_input_train})即可启动正常训练。

内容的提问来源于stack exchange,提问作者Do Hun Kim

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.19 20:50:24