tensorflow/models · error · ValueError
The linear layering config cannot be `None` when using the l
Error message
The linear layering config cannot be `None` when using the linear layering method.
What it means
Error "The linear layering config cannot be `None` when using the linear layering method." thrown in tensorflow/models.
Source
Thrown at official/recommendation/uplift/layers/heads/two_tower_logits_head.py:122
Args:
control_head: computes control logits from the control embedding. Its
input and output is expected to be a dense tensor.
treatment_head: computes treatment logits from the treatment embedding.
Its input and output is expected to be a dense tensor.
layering_config: configuration for the layering method. Defaults to no
layering.
**kwargs: base layer keyword arguments.
"""
super().__init__(**kwargs)
self._control_head = control_head
self._treatment_head = treatment_head
self._layering_config = layering_config
def build(self, input_shapes: tuple[tf.TensorShape, tf.TensorShape]):
if self._layering_config.layering_method == LayeringMethod.LINEAR_LAYERING:
if self._layering_config.linear_layering_config is None:
raise ValueError(
"The linear layering config cannot be `None` when using the linear"
" layering method."
)
# Build a learnable weight matrix that projects from the control embedding
# space to the treatment embedding space.
_, treatment_embedding_shape = input_shapes
self._linear_layering = tf_keras.layers.Dense(
units=treatment_embedding_shape[-1],
activation=None,
use_bias=True,
kernel_initializer=(
self._layering_config.linear_layering_config.kernel_initializer
),
kernel_regularizer=(
self._layering_config.linear_layering_config.kernel_regularizer
),
)
super().build(input_shapes)View on GitHub (pinned to e006f5f0d5)
When it happens
Trigger: Thrown at official/recommendation/uplift/layers/heads/two_tower_logits_head.py:122 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/3f90756e94902ba9.
Report an issue: GitHub.