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

"PyDataset: init does not call super().init(**kwargs) causing workers, use_multiprocessing, and max_queue_size parameters to be ignored." #21068

Open
slspencer opened this issue Mar 19, 2025 · 1 comment

Comments

@slspencer
Copy link

slspencer commented Mar 19, 2025

I'm encountering this warning when using ImageDataGenerator.flow_from_dataframe:

/usr/local/lib/python3.11/dist-packages/keras/src/trainers/data_adapters/py_dataset_adapter.py:121: UserWarning: Your `PyDataset` class should call `super().__init__(**kwargs)` in its constructor. `**kwargs` can include `workers`, `use_multiprocessing`, `max_queue_size`. Do not pass these arguments to `fit()`, as they will be ignored

I'm not subclassing PyDataset directly.

Proposed Fix:
Update the constructor of the relevant PyDataset subclass to call super().__init__(**kwargs), so that keyword arguments (including workers, use_multiprocessing, and max_queue_size) are initialized.

Environment:

Platform: Google Colab T4 GPU High-Ram
Operating System: Ubuntu 22.04.4 LTS

Python version: 3.11.11
numpy version: 2.0.2
pandas version: 2.2.2
tensor version: 2.18.0
keras 3.8.0
keras-hub 0.18.1
keras-nlp 0.18.1
tf_keras 2.18.0

Thanks, Keras team, for your time on this!

@dhantule
Copy link
Contributor

Hi @slspencer, Thanks for repeorting this.

Can you provide some reproducible code ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants