Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting the mlflow experiment does not work in interactive mode #256

Closed
Galileo-Galilei opened this issue Nov 4, 2021 · 0 comments · Fixed by #262
Closed

Setting the mlflow experiment does not work in interactive mode #256

Galileo-Galilei opened this issue Nov 4, 2021 · 0 comments · Fixed by #262
Assignees
Labels
bug Something isn't working

Comments

@Galileo-Galilei
Copy link
Owner

Galileo-Galilei commented Nov 4, 2021

Description

If I specify an experiment in mlflow.yml, and the set up the mlflow configuration interactively, all runs should be stored by default in this experiment while they are currently sotred in mlflow "Default" (0) experiment. This works when running "kedro run" through the CLI.

Steps to Reproduce

# mlflow.yml
experiment:
  name: my_awesome_experiment
  create: True  # if the specified `name` does not exists, should it be created?
# test.py

from kedro.framework.session import KedroSession
from kedro.framework.startup import bootstrap_project
from kedro_mlflow.config import get_mlflow_config

bootstrap_project(r"path/to/project")
with KedroSession.create(project_path=r"path/to/project"):
    config=get_mlflow_config()
    config.setup()
    
    mlflow.log_param("test_param",1) # this should be logged in "my_awesome_experiment" but is logged in "Default".

Does the bug also happen with the last version on master?

Yes

Potential solution

The faulty line is:

self._get_or_create_experiment()

We should use mlflow mlflow.set_experiment method, but it does not restore deleted experiment. This wil replace part of the logic here:

if self.experiment.create:
if self._experiment is None:
# case 1 : the experiment does not exist, it must be created manually
experiment_id = self._mlflow_client.create_experiment(
name=self.experiment.name
)
self._experiment = self._mlflow_client.get_experiment(
experiment_id=experiment_id
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: ✅ Done
1 participant