tensorflow/models · error · ValueError
The {name}_feature_encoder layer must be specified if the {n
Error message
The {name}_feature_encoder layer must be specified if the {name}_input_combiner is not None. What it means
Error "The {name}_feature_encoder layer must be specified if the {name}_input_combiner is not None." thrown in tensorflow/models.
Source
Thrown at official/recommendation/uplift/layers/uplift_networks/two_tower_uplift_network.py:121
)
self._validate_encoder_combiner_layers(
treatment_feature_encoder, treatment_input_combiner, "treatment"
)
def _validate_encoder_combiner_layers(
self,
encoder: tf_keras.layer.Layer,
combiner: tf_keras.layer.Layer,
name: str,
) -> None:
if encoder is not None and combiner is None:
raise ValueError(
f"The {name}_input_combiner layer must be specified if the"
f" {name}_feature_encoder is not None. Consider using"
" tf_keras.layers.Concatenate() as a combiner layer."
)
if encoder is None and combiner is not None:
raise ValueError(
f"The {name}_feature_encoder layer must be specified if the"
f" {name}_input_combiner is not None."
)
def call(
self,
inputs: types.DictOfTensors,
training: bool | None = None,
mask: tf.Tensor | None = None,
) -> types.TwoTowerNetworkOutputs:
"""Computes control and treatment logits.
Args:
inputs: dictionary of feature tensors to be passed to the backbone and
control/treatment feature encoder layers when set.
training: unused optional training flag.
mask: unused optional mask.
View on GitHub (pinned to e006f5f0d5)
When it happens
Trigger: Thrown at official/recommendation/uplift/layers/uplift_networks/two_tower_uplift_network.py:121 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of tensorflow/models@e006f5f0d5 (2026-08-24).
Data as JSON: /api/errors/8dc02c5b6cdd4979.
Report an issue: GitHub.