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 c52d71e commit 3bedb9aCopy full SHA for 3bedb9a
keras/src/layers/layer.py
@@ -1417,8 +1417,11 @@ def _untrack_variable(self, variable):
1417
def add_metric(self, *args, **kwargs):
1418
# Permanently disabled
1419
raise NotImplementedError(
1420
- "Layer `add_metric()` method is deprecated"
1421
- " add your metric in `Model.compile(metrics=[...]).`"
+ "Layer `add_metric()` method is deprecated. "
+ "Add your metric in `Model.compile(metrics=[...])`, "
1422
+ "or create metric trackers in init() or build() "
1423
+ "when subclassing the layer or model, then call "
1424
+ "`metric.update_state()` whenever necessary."
1425
)
1426
1427
def count_params(self):
0 commit comments