tensorflow/models · error · ValueError
Unsurpported pool_type %s
Error message
Unsurpported pool_type %s
What it means
Error "Unsurpported pool_type %s" thrown in tensorflow/models.
Source
Thrown at official/projects/maxvit/modeling/common_ops.py:80
if act_fn is None:
act_fn = 'gelu'
if isinstance(act_fn, str):
return functools.partial(activation_fn, act_fn=act_fn)
elif callable(act_fn):
return act_fn
else:
raise ValueError('Unsupported act_fn %s.' % act_fn)
def pooling_2d(inputs, pool_type, stride, **kwargs):
"""Perform 2D pooling."""
if stride > 1:
if pool_type == 'max':
pool_op = tf_keras.layers.MaxPool2D
elif pool_type == 'avg':
pool_op = tf_keras.layers.AveragePooling2D
else:
raise ValueError('Unsurpported pool_type %s' % pool_type)
output = pool_op(
pool_size=(stride, stride), strides=(stride, stride), **kwargs
)(inputs)
else:
output = inputs
return output
def drop_connect(inputs, training, survival_prob):
"""Drop the entire conv with given survival probability."""
# "Deep Networks with Stochastic Depth", https://arxiv.org/pdf/1603.09382.pdf
if not training:
return inputs
# Compute tensor.
batch_size = tf.shape(inputs)[0]
random_tensor = survival_prob
random_tensor += tf.random.uniform([batch_size], dtype=inputs.dtype)View on GitHub (pinned to e006f5f0d5)
When it happens
Trigger: Thrown at official/projects/maxvit/modeling/common_ops.py:80 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/e759e4c4ebc0bcef.
Report an issue: GitHub.