We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e32175a commit 22ab5a3Copy full SHA for 22ab5a3
keras/src/trainers/data_adapters/__init__.py
@@ -97,7 +97,12 @@ def get_data_adapter(
97
if class_weight is not None:
98
raise ValueError(
99
"Argument `class_weight` is not supported for torch "
100
- f"DataLoader inputs. Received: class_weight={class_weight}"
+ f"DataLoader inputs. You can modify your `__getitem__ ` method"
101
+ " to return input tensor, label and class_weight. "
102
+ "Alternatively, use a custom training loop. See the User Guide "
103
+ "https://keras.io/guides/custom_train_step_in_torch/"
104
+ "#supporting-sampleweight-amp-classweight for more details. "
105
+ f"Received: class_weight={class_weight}"
106
)
107
return TorchDataLoaderAdapter(x)
108
# TODO: should we warn or not?
0 commit comments