mlflow.active_run()
returns nothing so I can't just use
current_rui_id = mlflow.active_run().info.run_id
I have to get run_id inside of this construction for being able to continue logging parameters, metrics and artifacts inside of another block but for the same model:
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')
I have to get current run_id to continue training inside the same run
with mlflow.start_run(run_id="215d3a71925a4709a9b694c45012988a"):
"""
fit again
log_metrics
"""
pytorch.log_model(learn.model, f'model')
mlflow.log_artifact('./outputs/fig2.jpg')