Thiago Valejo
08/12/2025, 3:14 PMmodel:
type: kedro_mlflow.io.models.MlflowModelTrackingDataset
flavor: mlflow.sklearn
save_args:
registered_model_name:model
model_loader:
type: kedro_mlflow.io.models.MlflowModelRegistryDataset
flavor: mlflow.sklearn
model_name: "model"
alias: "champion"
If I try to load the model in a new kedro session, it will demand a run_id. If I try to use the model_loader. It will complain that the model (the wrapper SklearnPipeline object) don’t have a metadata attribute, giving this error message:
│ /opt/anaconda3/envs/topazDS_2/lib/python3.11/site-packages/kedro_mlflow/io/models/mlflow_model_r │
│ egistry_dataset.py:98 in _load │
│ │
│ 95 │ │ # because the same run can be registered under several different names │
│ 96 │ │ # in the registry. See <https://github.com/Galileo-Galilei/kedro-mlflow/issues/5> │
│ 97 │ │ import pdb; pdb.set_trace() │
│ ❱ 98 │ │ <http://self._logger.info|self._logger.info>(f"Loading model from run_id='{model.metadata.run_id}'") │
│ 99 │ │ return model │
│ 100 │ │
│ 101 │ def _save(self, model: Any) -> None: │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'SklearnPipeline' object has no attribute 'metadata'
DatasetError: Failed while loading data from dataset
kedro_mlflow.io.models.mlflow_model_registry_dataset.MlflowModelRegistryDataset(model_uri='models:/mill1_west_no_we
nco_st_model@champion', model_name='mill1_west_no_wenco_st_model', alias='champion', flavor='mlflow.sklearn',
pyfunc_workflow='python_model').
'SklearnPipeline' object has no attribute 'metadata'
I think that the MlflowModelRegistryDataset class wasn't expecting the model to be a sklearn object. Probably there's a difference in how I'm saving the model (MlflowModelTrackingDataset) and how I'm loading it (MlflowModelRegistryDataset).
How I could load the champion model?
@Rashida Kanchwala @Ravi Kumar PillaRavi Kumar Pilla
08/12/2025, 3:18 PMRavi Kumar Pilla
08/12/2025, 4:43 PMMlflowRegistryDataset it works fine. This was introduced in 0.13.3 release. I am not sure if there is a schema for the model which is saved using MlflowModelTrackingDataset
<http://self._logger.info|self._logger.info>(f"Loading model from run_id='{model.metadata.run_id}'")Ravi Kumar Pilla
08/12/2025, 4:45 PMYolan Honoré-Rougé
08/12/2025, 4:47 PMRavi Kumar Pilla
08/12/2025, 4:48 PMRavi Kumar Pilla
08/12/2025, 4:52 PMThiago Valejo
08/12/2025, 4:53 PMRavi Kumar Pilla
08/12/2025, 4:53 PMRavi Kumar Pilla
08/12/2025, 4:53 PMRavi Kumar Pilla
08/12/2025, 4:53 PMRavi Kumar Pilla
08/12/2025, 7:46 PMYolan Honoré-Rougé
08/12/2025, 7:56 PMRavi Kumar Pilla
08/12/2025, 7:57 PMYolan Honoré-Rougé
08/13/2025, 8:34 PMRavi Kumar Pilla
08/13/2025, 9:16 PMThiago Valejo
08/14/2025, 8:37 PM