TF error message fixit: keras/optimizer_v2/gradient_descent.
@@ -107,7 +107,8 @@ class SGD(optimizer_v2.OptimizerV2):
if isinstance(momentum, tf.Tensor) or callable(momentum) or momentum > 0:
self._momentum = True
if isinstance(momentum, (int, float)) and (momentum < 0 or momentum > 1):
- raise ValueError("`momentum` must be between [0, 1].")
+ raise ValueError(f"`momentum` must be between [0, 1]. Received: "
+ f"momentum={momentum} (of type {type(momentum)}).")
self._set_hyper("momentum", momentum)
self.nesterov = nesterov
