{"record":{"id":"d06b499bc1011383","repo":"tensorflow/models","slug":"unexpected-inputs-type-to-s-d06b49","errorCode":null,"errorMessage":"Unexpected inputs type to %s.","messagePattern":"Unexpected inputs type to (.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/pixel/modeling/pixel.py","lineNumber":115,"sourceCode":"    return self.token_cls(patch_embeds)\n\n  def call(self, inputs):  # pylint:disable=signature-mismatch\n    if isinstance(inputs, dict):\n      images = inputs.get('pixel_values', None)\n      attention_mask = inputs.get('attention_mask', None)\n      attention_mask = tf.transpose(\n          tf.concat(\n              values=[\n                  tf.ones((1, tf.shape(attention_mask)[0]), tf.float32),\n                  tf.transpose(attention_mask),\n              ],\n              axis=0,\n          )\n      )\n      attention_mask = tf.einsum('ij,ik->ijk', attention_mask, attention_mask)\n      attention_mask = tf.cast(attention_mask, tf.int32)\n    else:\n      raise ValueError('Unexpected inputs type to %s.' % self.__class__)\n\n    images = tf.transpose(images, perm=[0, 2, 3, 1])\n    patch_embeds = self.to_embed(images)\n    patch_shape = tf.shape(patch_embeds)\n    patch_embeds = tf.reshape(\n        patch_embeds, (patch_shape[0], -1, patch_shape[-1])\n    )\n    patch_embeds = self.insert_cls(patch_embeds)\n\n    return self.encoder((patch_embeds, attention_mask))\n\n\nclass PixelClassifier(tf_keras.layers.Layer):\n  \"\"\"Pixel classifier for finetuning. Uses the cls token.\"\"\"\n\n  def __init__(self, encoder, num_classes, **kwargs):\n    super().__init__(**kwargs)\n    self.encoder = encoder","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/pixel/modeling/pixel.py#L97-L133","documentation":"Error \"Unexpected inputs type to %s.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/pixel/modeling/pixel.py:115 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}