{"record":{"id":"398ee4d633d30bcd","repo":"tensorflow/models","slug":"decoder-s-output-should-be-a-dict-but-got-decoder","errorCode":null,"errorMessage":"decoder's output should be a dict,but got {decoder_output}","messagePattern":"decoder's output should be a dict,but got (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/perceiver/modeling/models/classifier.py","lineNumber":190,"sourceCode":"\n    encoder_inputs = {\n        'input_word_ids': word_ids,\n        'input_mask': input_mask,\n        'input_type_ids': input_type_ids,\n    }\n    encoder_outputs = self._network(encoder_inputs)\n\n    if 'sequence_output' not in encoder_outputs:\n      if 'latent_output' in encoder_outputs:\n        z = encoder_outputs['latent_output']\n        decoder_inputs = {'latent_output': z, 'input_mask': input_mask}\n        decoder_output = self._decoder(decoder_inputs)  # pyrefly: ignore[not-callable]\n\n        outputs = dict()\n        if isinstance(decoder_output, dict):\n          outputs = decoder_output\n        else:\n          raise ValueError('decoder\\'s output should be a dict,'\n                           f'but got {decoder_output}')\n      else:\n        raise ValueError('If `sequence_output` is not in encoder output,'\n                         '`latent_output` must be in encoder output.')\n    else:\n      outputs = encoder_outputs\n\n    return self.classifier(outputs['sequence_output'])\n\n  @property\n  def checkpoint_items(self):\n    \"\"\"Returns a dictionary of items to be additionally checkpointed.\"\"\"\n    items = dict(encoder=self._network, decoder=self._decoder)\n    if hasattr(self.classifier, 'checkpoint_items'):\n      for key, item in self.classifier.checkpoint_items.items():\n        items['.'.join([self.classifier.name, key])] = item\n    return items\n","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/perceiver/modeling/models/classifier.py#L172-L208","documentation":"Error \"decoder's output should be a dict,but got {decoder_output}\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/perceiver/modeling/models/classifier.py:190 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"}