{"record":{"id":"8dc02c5b6cdd4979","repo":"tensorflow/models","slug":"the-name-feature-encoder-layer-must-be-specified","errorCode":null,"errorMessage":"The {name}_feature_encoder layer must be specified if the {name}_input_combiner is not None.","messagePattern":"The (.+?)_feature_encoder layer must be specified if the (.+?)_input_combiner is not None\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/recommendation/uplift/layers/uplift_networks/two_tower_uplift_network.py","lineNumber":121,"sourceCode":"    )\n    self._validate_encoder_combiner_layers(\n        treatment_feature_encoder, treatment_input_combiner, \"treatment\"\n    )\n\n  def _validate_encoder_combiner_layers(\n      self,\n      encoder: tf_keras.layer.Layer,\n      combiner: tf_keras.layer.Layer,\n      name: str,\n  ) -> None:\n    if encoder is not None and combiner is None:\n      raise ValueError(\n          f\"The {name}_input_combiner layer must be specified if the\"\n          f\" {name}_feature_encoder is not None. Consider using\"\n          \" tf_keras.layers.Concatenate() as a combiner layer.\"\n      )\n    if encoder is None and combiner is not None:\n      raise ValueError(\n          f\"The {name}_feature_encoder layer must be specified if the\"\n          f\" {name}_input_combiner is not None.\"\n      )\n\n  def call(\n      self,\n      inputs: types.DictOfTensors,\n      training: bool | None = None,\n      mask: tf.Tensor | None = None,\n  ) -> types.TwoTowerNetworkOutputs:\n    \"\"\"Computes control and treatment logits.\n\n    Args:\n      inputs: dictionary of feature tensors to be passed to the backbone and\n        control/treatment feature encoder layers when set.\n      training: unused optional training flag.\n      mask: unused optional mask.\n","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/recommendation/uplift/layers/uplift_networks/two_tower_uplift_network.py#L103-L139","documentation":"Error \"The {name}_feature_encoder layer must be specified if the {name}_input_combiner is not None.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/recommendation/uplift/layers/uplift_networks/two_tower_uplift_network.py:121 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"}