{"record":{"id":"023036f323a58dd8","repo":"tensorflow/models","slug":"unrecognized-pooler-type-pooler-023036","errorCode":null,"errorMessage":"unrecognized pooler type: {pooler}","messagePattern":"unrecognized pooler type: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/modeling/backbones/vit.py","lineNumber":318,"sourceCode":"\n    endpoints = {}\n    if output_attention_scores:\n      x, attention_scores = encoder_output\n      endpoints['attention_scores'] = attention_scores\n    else:\n      x = encoder_output\n\n    if pooler == 'token':\n      output_feature = x[:, 1:]\n      x = x[:, 0]\n    elif pooler == 'gap':\n      output_feature = x\n      x = tf.reduce_mean(x, axis=1)\n    elif pooler == 'none':\n      output_feature = x\n      x = tf.identity(x, name='encoded_tokens')\n    else:\n      raise ValueError(f'unrecognized pooler type: {pooler}')\n\n    if output_2d_feature_maps:\n      # Use the closest feature level.\n      feat_level = round(math.log2(patch_size))\n      logging.info(\n          'VisionTransformer patch size %d and feature level: %d',\n          patch_size,\n          feat_level,\n      )\n      endpoints[str(feat_level)] = tf.reshape(\n          output_feature, [-1, feat_h, feat_w, x.shape.as_list()[-1]])\n\n      # Don\"t include `pre_logits` or `encoded_tokens` to support decoders.\n      self._output_specs = {k: v.shape for k, v in endpoints.items()}\n\n    if representation_size:\n      x = layers.Dense(\n          representation_size,","sourceCodeStart":300,"sourceCodeEnd":336,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/modeling/backbones/vit.py#L300-L336","documentation":"Error \"unrecognized pooler type: {pooler}\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/modeling/backbones/vit.py:318 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set pooler to 'token' or 'gap' in the ViT backbone config.","Check the pooler value for typos."],"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"}