AttributeError: 'Pandas' object has no attribute 'path'
Issue arose when using commit with hash dc7e73ebaa485dcc759881e10b2bcfeb3d578985
When trying to load the datasets from MLFlow using the following code:
from rationai.mlkit.data import MLFlowSlides
import mlflow
mlflow.set_tracking_uri('http://mlflow.rationai-mlflow:5000/')
dataset = MLFlowSlides(uris=[
"mlflow-artifacts:/4/6fa69d4e93bc4001911c3445823d4874/artifacts/dataset",
"mlflow-artifacts:/4/a51f32dae178463b813103615670c515/artifacts/dataset",
"mlflow-artifacts:/4/812b38626c614dfaac7536a7d1a46e3e/artifacts/dataset",
"mlflow-artifacts:/4/dd8e6c4b8ec44bbdb9f0975acb278673/artifacts/dataset"
])
the following error arises:
AttributeError Traceback (most recent call last)
Cell In[1], line 7
3 import mlflow
5 mlflow.set_tracking_uri('http://mlflow.rationai-mlflow:5000/')
----> 7 dataset = MLFlowSlides(uris=[
8 "mlflow-artifacts:/4/6fa69d4e93bc4001911c3445823d4874/artifacts/dataset",
9 "mlflow-artifacts:/4/a51f32dae178463b813103615670c515/artifacts/dataset",
10 "mlflow-artifacts:/4/812b38626c614dfaac7536a7d1a46e3e/artifacts/dataset",
11 "mlflow-artifacts:/4/dd8e6c4b8ec44bbdb9f0975acb278673/artifacts/dataset"
12 ])
File ~/unveil/.venv/lib/python3.11/site-packages/rationai/mlkit/data/mlflow_slides.py:20, in MLFlowSlides.__init__(self, uris)
18 self.uris = uris
19 self.slides, self.tiles = self.load_slides_and_tiles(uris)
---> 20 super().__init__(self.generate_datasets())
File ~/unveil/.venv/lib/python3.11/site-packages/torch/utils/data/dataset.py:327, in ConcatDataset.__init__(self, datasets)
325 def __init__(self, datasets: Iterable[Dataset]) -> None:
326 super().__init__()
--> 327 self.datasets = list(datasets)
328 assert len(self.datasets) > 0, "datasets should not be an empty iterable" # type: ignore[arg-type]
329 for d in self.datasets:
File ~/unveil/.venv/lib/python3.11/site-packages/rationai/mlkit/data/mlflow_slides.py:25, in <genexpr>(.0)
22 def generate_datasets(self) -> Iterable[Dataset]:
23 return (
24 SlideTiles(
---> 25 slide_path=slide.path,
26 level=slide.level,
27 tile_width=slide.tile_width,
28 tile_height=slide.tile_height,
29 tiles=self.filter_tiles_by_slide(slide.path),
30 )
31 for slide in self.slides.itertuples()
32 )
AttributeError: 'Pandas' object has no attribute 'path'
How is the 'path' parameter supposed to get into the Pandas object?
Edited by Adam Bajger