tensorflow/models · error · ValueError

Unexpected inputs type to %s.

Error message

Unexpected inputs type to %s.

What it means

Error "Unexpected inputs type to %s." thrown in tensorflow/models.

Source

Thrown at official/projects/lra/lra_dual_encoder.py:94

    self.network = network
    self.classifier = tfm.nlp.layers.ClassificationHead(
        inner_dim=0 if use_encoder_pooler else inner_dim,
        num_classes=num_classes,
        initializer=initializer,
        dropout_rate=dropout_rate,
        name=head_name,
    )

  def call(self, inputs):
    if isinstance(inputs, dict):
      left_word_ids = inputs.get('left_word_ids')
      left_mask = inputs.get('left_mask')

      right_word_ids = inputs.get('right_word_ids')
      right_mask = inputs.get('right_mask')
    else:
      raise ValueError('Unexpected inputs type to %s.' % self.__class__)

    inputs = [left_word_ids, left_mask, right_word_ids, right_mask]

    left_inputs = [left_word_ids, left_mask]
    left_outputs = self.network(left_inputs)
    right_inputs = [right_word_ids, right_mask]
    right_outputs = self.network(right_inputs)

    if self._use_encoder_pooler:
      # Because we have a copy of inputs to create this Model object, we can
      # invoke the Network object with its own input tensors to start the Model.
      if isinstance(left_outputs, list):
        left_cls_inputs = left_outputs[1]
        right_cls_inputs = right_outputs[1]
      else:
        left_cls_inputs = left_outputs['pooled_output']
        right_cls_inputs = right_outputs['pooled_output']
    else:

View on GitHub (pinned to e006f5f0d5)

When it happens

Trigger: Thrown at official/projects/lra/lra_dual_encoder.py:94 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tensorflow/models@e006f5f0d5 (2026-08-24). Data as JSON: /api/errors/8b90f6397b5dd436. Report an issue: GitHub.