【发布时间】:2019-05-25 19:44:04
【问题描述】:
我正在尝试将超参数调整作业中的最佳估算器实施到管道对象中以部署端点。
我已尽最大努力阅读文档以将调优作业的结果包含在管道中,但我在创建 Model() 类对象时遇到了问题。
# This is the hyperparameter tuning job
tuner.fit({'train': s3_train, 'validation': s3_val},
include_cls_metadata=False)
#With a standard Model (Not from the tuner) the process was as follows:
scikit_learn_inferencee_model_name = sklearn_preprocessor.create_model()
xgb_model_name = Model(model_data=xgb_model.model_data, image=xgb_image)
model_name = 'xgb-inference-pipeline-' + timestamp_prefix
endpoint_name = 'xgb-inference-pipeline-ep-' + timestamp_prefix
sm_model = PipelineModel(
name=model_name,
role=role,
models=[
scikit_learn_inferencee_model_name,
xgb_model_name])
sm_model.deploy(initial_instance_count=1, instance_type='ml.c4.xlarge',
endpoint_name=endpoint_name)
我希望能够使用调优作业的结果干净地实例化模型对象,并将其传递给 PipelineModel 对象。任何指导表示赞赏。
【问题讨论】:
标签: python amazon-web-services pipeline amazon-sagemaker