mlflow.active_run()不返回任何内容,所以我不能只使用
current_rui_id = mlflow.active_run().info.run_id
我必须在此构造中获取run_id ,以便能够继续在另一个块内记录参数、指标和工件,但对于同一模型:
with mlflow.start_run(run_name="test_ololo"):
"""
fitting a model here ...
"""
for name, val in metrics:
mlflow.log_metric(name, np.float(val))
# Log our parameters into mlflow
for k, v in params.items():
mlflow.log_param(key=k, value=v)
pytorch.log_model(learn.model, f'model')
mlflow.log_artifact('./outputs/fig.jpg')
Run Code Online (Sandbox Code Playgroud)
我必须获取当前的run_id才能在同一次运行中继续训练
with mlflow.start_run(run_id="215d3a71925a4709a9b694c45012988a"):
"""
fit again
log_metrics
"""
pytorch.log_model(learn.model, f'model')
mlflow.log_artifact('./outputs/fig2.jpg')
Run Code Online (Sandbox Code Playgroud) 我们不小心删除了一个管道,我们需要恢复它,但是如何恢复呢?
感谢您的帮助