答:Keras 3.10.0 的 Layer.add_metric 会抛出 NotImplementedError。普通模型指标放到 compile(metrics=...)。需要在自定义逻辑中收集时,创建指标对象并调用 update_state。
题干与完整题解免费阅读第 1 / 1 页
本页 1 道,共 1 道浏览其他领域
答:Keras 3.10.0 的 Layer.add_metric 会抛出 NotImplementedError。普通模型指标放到 compile(metrics=...)。需要在自定义逻辑中收集时,创建指标对象并调用 update_state。