我已经使用Hyperdrive成功地在Azure机器学习服务上训练了一个模型,该模型现在已经产生了hyperdrive运行实例
hyperdrive_run = exp.submit(config=hypertune_config)
hyperdrive_run
best_run = hyperdrive_run.get_best_run_by_primary_metric()
下一步,我想在向模型添加描述的同时注册模型。
pumps_rf = best_run.register_model(model_name='pumps_rf', model_path='outputs/rf.pkl')
Azure门户上的AML工作区的“模型”部分中有一个description
列,但是register_model
方法似乎没有description
标志。那么,如何在模型中添加描述,以便在Azure Portal中看到它?
答案 0 :(得分:1)
好问题:)。
查看API的当前版本,您似乎无法使用Run.register_model
添加描述,如已确认的by the docs所示。
不过,您可以通过使用Model.register
方法注册模型来解决此问题,该方法幸运地包括description
的自变量,详细说明为here。对于您的情况,还需要先download the files。
简而言之,使用类似以下内容的
:best_run.download_file('outputs/rf.pkl', output_file_path='./rf.pkl')
Model.register(workspace=ws, model_path='./rf.pkl', model_name="pumps_rf", description="There are many models like it, but this one is mine.")
答案 1 :(得分:0)
嗨,我发现了同样的问题,我用这个解决方案解决了:How to register model from the Azure ML Pipeline Script step
这很奇怪,因为它没有在任何官方示例中列出。