{"record":{"id":"9278d097d8956d78","repo":"tensorflow/models","slug":"backbone-depth-should-be-equal-to-3d-unet-decoder","errorCode":null,"errorMessage":"Backbone depth should be equal to 3D UNet decoder's depth.","messagePattern":"Backbone depth should be equal to 3D UNet decoder's depth\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/volumetric_models/modeling/decoders/unet_3d_decoder.py","lineNumber":139,"sourceCode":"          kernel_regularizer=kernel_regularizer,\n          activation=activation,\n          use_sync_bn=use_sync_bn,\n          norm_momentum=norm_momentum,\n          norm_epsilon=norm_epsilon,\n          use_batch_normalization=use_batch_normalization)(\n              x)\n\n    feats = {'1': x}\n    self._output_specs = {l: feats[l].get_shape() for l in feats}\n\n    super(UNet3DDecoder, self).__init__(inputs=inputs, outputs=feats, **kwargs)\n\n  def _build_input_pyramid(self, input_specs: Dict[str, tf.TensorShape],\n                           depth: int) -> Dict[str, tf.Tensor]:\n    \"\"\"Builds input pyramid features.\"\"\"\n    assert isinstance(input_specs, dict)\n    if len(input_specs.keys()) > depth:\n      raise ValueError(\n          'Backbone depth should be equal to 3D UNet decoder\\'s depth.')\n\n    inputs = {}\n    for level, spec in input_specs.items():\n      inputs[level] = tf_keras.Input(shape=spec[1:])\n    return inputs\n\n  def get_config(self) -> Mapping[str, Any]:\n    return self._config_dict\n\n  @classmethod\n  def from_config(cls, config: Mapping[str, Any], custom_objects=None):\n    return cls(**config)\n\n  @property\n  def output_specs(self) -> Mapping[str, tf.TensorShape]:\n    \"\"\"A dict of {level: TensorShape} pairs for the model output.\"\"\"\n    return self._output_specs","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/volumetric_models/modeling/decoders/unet_3d_decoder.py#L121-L157","documentation":"Error \"Backbone depth should be equal to 3D UNet decoder's depth.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/volumetric_models/modeling/decoders/unet_3d_decoder.py:139 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"}