Skip to content

Improve error message for class_weight with PyTorch DataLoaders #21414

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sonali-kumari1
Copy link
Contributor

@sonali-kumari1 sonali-kumari1 commented Jun 24, 2025

Updated the error message for class_weight with PyTorch DataLoaders to suggest two solutions: modifying the __getitem__ method or using a custom training loop. Included a link to the user guide for the custom training loop.

Fixes #21355

@codecov-commenter
Copy link

codecov-commenter commented Jun 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.72%. Comparing base (3d6022a) to head (7f44384).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #21414   +/-   ##
=======================================
  Coverage   82.72%   82.72%           
=======================================
  Files         565      565           
  Lines       55222    55222           
  Branches     8609     8609           
=======================================
  Hits        45683    45683           
  Misses       7428     7428           
  Partials     2111     2111           
Flag Coverage Δ
keras 82.53% <ø> (ø)
keras-jax 63.33% <ø> (ø)
keras-numpy 58.53% <ø> (+<0.01%) ⬆️
keras-openvino 33.79% <ø> (ø)
keras-tensorflow 63.74% <ø> (ø)
keras-torch 63.37% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonali-kumari1 sonali-kumari1 added the keras-team-review-pending Pending review by a Keras team member. label Jun 25, 2025
@gbaned gbaned requested a review from mattdangerw June 25, 2025 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review keras-team-review-pending Pending review by a Keras team member. size:XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Documentation: better info about class_weight and/or DataAdapters
3 participants