Hi , I want to use the pillow.ImageDatSet. But get...
# questions
s
Hi , I want to use the pillow.ImageDatSet. But getting an error. Pasting the changes here: The documentation doesnt have YAML API described too. Am I missing something?
Copy code
imageset:
  type: PartitionedDataSet
  dataset: {
      "type": pillow.ImageDataSet
  }
  path: <path_to_data>
  filename_suffix: ".jpg"

getting below error:

kedro.io.core.DataSetError:
Object 'ImageDataSet' cannot be loaded from 'kedro.extras.datasets.pillow'. Please see the documentation on how to install relevant dependencies for kedro.extras.datasets.pillow.ImageDataSet:
<https://kedro.readthedocs.io/en/stable/kedro_project_setup/dependencies.html>.
Failed to instantiate DataSet 'imageset' of type 'kedro.io.partitioned_dataset.PartitionedDataSet'.
kedro.framework.cli.utils.KedroCliError:
Object 'ImageDataSet' cannot be loaded from 'kedro.extras.datasets.pillow'. Please see the documentation on how to install relevant dependencies for kedro.extras.datasets.pillow.ImageDataSet:
<https://kedro.readthedocs.io/en/stable/kedro_project_setup/dependencies.html>.
Failed to instantiate DataSet 'imageset' of type 'kedro.io.partitioned_dataset.PartitionedDataSet'.
Run with --verbose to see the full exception
Error:
Object 'ImageDataSet' cannot be loaded from 'kedro.extras.datasets.pillow'. Please see the documentation on how to install relevant dependencies for kedro.extras.datasets.pillow.ImageDataSet:
<https://kedro.readthedocs.io/en/stable/kedro_project_setup/dependencies.html>.
Failed to instantiate DataSet 'imageset' of type 'kedro.io.partitioned_dataset.PartitionedDataSet'.
d
have you installed the necessary dependencies?
pip install kedro[pillow.ImageDataSet]
s
Also I would guess that the yml needs to look more like this:
Copy code
imageset:
    type: pillow.ImageDataSet
    filepath: folder/to/file.jpg
I haven't used this dataset before though so not sure if there are any special args needed. But this is the general layout. Edit: unless you want to use it as a partitioned dataset in which case your syntax is ok.
s
@datajoely Yes, have installed the dependency @Sean Westgate Thanks. Yes, I want to use it as a partitioned dataset
d
In these situations I like to jump in o a Kedro ipython session and try importing the dataset class directly and use the python API
so
from <http://kedro.io|kedro.io> import PartitionedDataSet
and
from kedro.datasets.pillow import ImageDataSet
💯 1
👍 1