0
votes

Used mlflow.set_tracking_uri to set up tracking_uri and set_experiment, got an error and check back to run following code again. got an error that "Exception: Run with UUID is already active." Try to use mlflow.end_run to end current run, but got RestException: RESOURCE_DOES_NOT_EXIST: Run UUID not found. Currently stuck in this infinite loop. Any suggestion?

    mlflow.set_experiment("my_experiment")
    mlflow.start_run(run_name='my_project')
    mlflow.set_tag('input_len',len(input))
    mlflow.log_param('metrics', r2)
1
Finally restart the Jupyter notebook kernel. Run again, it works.newleaf
Normally, the command mlflow.end_run() brings relief in this situation. But, in my experience, it does not always works and there must be a lock somewhere...user989762

1 Answers

0
votes

My case was slightly different, but I'm posting the solution here in case it helps newcomers to this thread. I was accidentally setting run tags before starting the run

mlflow.set_experiment('my_experiment')
mlflow.set_tag('input_len', len(input))  # Auto-creates a run ID
mlflow.start_run(run_name='my_project')  # Tries to name the same run, throwing error

Ensuring that start_run came before all other logging/tags solved the issue