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/mega_encoder.py:214

        word_ids = inputs.get('input_word_ids')
        mask = inputs.get('input_mask')
        type_ids = inputs.get('input_type_ids', None)
        word_embeddings = inputs.get('input_word_embeddings', None)
      elif 'left_word_ids' in inputs.keys():
        word_ids = inputs.get('left_word_ids')
        mask = inputs.get('left_mask')
      elif 'right_word_ids' in inputs.keys():
        word_ids = inputs.get('right_word_ids')
        mask = inputs.get('right_mask')
      dense_inputs = inputs.get('dense_inputs', None)
      dense_mask = inputs.get('dense_mask', None)
    elif isinstance(inputs, list):
      ## Dual Encoder Tasks
      word_ids, mask = inputs
      type_ids = None
      dense_inputs, dense_mask = None, None
    else:
      raise ValueError('Unexpected inputs type to %s.' % self.__class__)

    if type_ids is None:  # pyrefly: ignore[unbound-name]
      type_ids = tf.zeros_like(mask)  # pyrefly: ignore[unbound-name]

    if word_embeddings is None:
      word_embeddings = self._embedding_layer(word_ids)  # pyrefly: ignore[unbound-name]

    if dense_inputs is not None:
      mask = tf.concat([mask, dense_mask], axis=1)

    embeddings = self._embedding_norm_layer(word_embeddings)
    embeddings = self._embedding_dropout(embeddings)

    encoder_outputs = []
    x = embeddings

    for l in range(self._num_layers):
      if x.shape[0] is None:

View on GitHub (pinned to e006f5f0d5)

When it happens

Trigger: Thrown at official/projects/lra/mega_encoder.py:214 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/765691963f291a81. Report an issue: GitHub.