diff --git a/keras/engine/topology.py b/keras/engine/topology.py index f6c8a7332ad..d25fdd560e8 100644 --- a/keras/engine/topology.py +++ b/keras/engine/topology.py @@ -1098,7 +1098,7 @@ def add_loss(self, losses, inputs=None): if hasattr(self, '_losses'): self._losses += losses # Update self._per_input_updates - if isinstance(input, list) and inputs == []: + if isinstance(inputs, list) and inputs == []: inputs = None if inputs is not None: inputs_hash = _object_list_uid(inputs)