我正在尝试将最佳估计器从超参数优化作业实现到管道对象,以部署端点。在
我已经阅读了文档,尽力将优化作业的结果包含在管道中,但是在创建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)
我希望能够使用优化作业的结果清晰地实例化一个model对象,并将其传递到PipelineModel对象。欢迎任何指导。在
我想你走对了。你有什么错误吗?请参考这个notebook,以从调谐器实例化模型并在推理管道中使用。在
根据评论编辑以前的回复。要从超参数优化作业的最佳训练作业创建模型,可以使用下面的代码片段
相关问题 更多 >
编程相关推荐