{"record":{"id":"eb563877b77f6028","repo":"tensorflow/models","slug":"inconsistent-decoder-type-decoder-type-need-to-eb5638","errorCode":null,"errorMessage":"Inconsistent decoder type {decoder_type}. Need to be `aspp`.","messagePattern":"Inconsistent decoder type (.+?)\\. Need to be `aspp`\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/modeling/decoders/aspp.py","lineNumber":184,"sourceCode":"  Args:\n    input_specs: A `dict` of input specifications. A dictionary consists of\n      {level: TensorShape} from a backbone. Note this is for consistent\n        interface, and is not used by ASPP decoder.\n    model_config: A OneOfConfig. Model config.\n    l2_regularizer: A `tf_keras.regularizers.Regularizer` instance. Default to\n      None.\n\n  Returns:\n    A `tf_keras.Model` instance of the ASPP decoder.\n\n  Raises:\n    ValueError: If the model_config.decoder.type is not `aspp`.\n  \"\"\"\n  del input_specs  # input_specs is not used by ASPP decoder.\n  decoder_type = model_config.decoder.type\n  decoder_cfg = model_config.decoder.get()\n  if decoder_type != 'aspp':\n    raise ValueError(f'Inconsistent decoder type {decoder_type}. '\n                     'Need to be `aspp`.')\n\n  norm_activation_config = model_config.norm_activation\n  return ASPP(  # pyrefly: ignore[bad-return]\n      level=decoder_cfg.level,\n      dilation_rates=decoder_cfg.dilation_rates,\n      num_filters=decoder_cfg.num_filters,\n      use_depthwise_convolution=decoder_cfg.use_depthwise_convolution,\n      pool_kernel_size=decoder_cfg.pool_kernel_size,\n      dropout_rate=decoder_cfg.dropout_rate,\n      use_sync_bn=norm_activation_config.use_sync_bn,\n      norm_momentum=norm_activation_config.norm_momentum,\n      norm_epsilon=norm_activation_config.norm_epsilon,\n      activation=norm_activation_config.activation,\n      kernel_regularizer=l2_regularizer,\n      spp_layer_version=decoder_cfg.spp_layer_version,\n      output_tensor=decoder_cfg.output_tensor)\n","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/modeling/decoders/aspp.py#L166-L202","documentation":"Error \"Inconsistent decoder type {decoder_type}. Need to be `aspp`.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/modeling/decoders/aspp.py:184 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the decoder type to 'aspp' when building an ASPP decoder.","Use the matching factory/config class so the decoder type is consistent."],"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"}