tensorflow/models · error · ValueError

Requested downsampling at a non-existing middle depthwise co

Error message

Requested downsampling at a non-existing middle depthwise conv.

What it means

Error "Requested downsampling at a non-existing middle depthwise conv." thrown in tensorflow/models.

Source

Thrown at official/projects/qat/vision/modeling/layers/nn_blocks.py:837

    self._stochastic_depth_drop_rate = stochastic_depth_drop_rate
    self._dilation_rate = dilation_rate
    self._use_sync_bn = use_sync_bn
    self._regularize_depthwise = regularize_depthwise
    self._use_residual = use_residual
    self._activation = activation
    self._depthwise_activation = depthwise_activation
    self._kernel_initializer = kernel_initializer
    self._use_layer_scale = use_layer_scale
    self._layer_scale_init_value = layer_scale_init_value
    self._norm_momentum = norm_momentum
    self._norm_epsilon = norm_epsilon
    self._kernel_regularizer = kernel_regularizer
    self._bias_regularizer = bias_regularizer
    self._output_intermediate_endpoints = output_intermediate_endpoints

    if strides > 1:
      if middle_dw_downsample and not middle_dw_kernel_size:
        raise ValueError(
            'Requested downsampling at a non-existing middle depthwise conv.'
        )
      if not middle_dw_downsample and not start_dw_kernel_size:
        raise ValueError(
            'Requested downsampling at a non-existing starting depthwise conv.'
        )

    if use_sync_bn:
      norm_layer = tf_keras.layers.experimental.SyncBatchNormalization
    else:
      norm_layer = tf_keras.layers.BatchNormalization
    self._norm_with_quantize = helper.BatchNormalizationQuantized(norm_layer)
    self._norm = helper.BatchNormalizationNoQuantized(norm_layer)

    if tf_keras.backend.image_data_format() == 'channels_last':
      self._bn_axis = -1
    else:
      self._bn_axis = 1

View on GitHub (pinned to e006f5f0d5)

When it happens

Trigger: Thrown at official/projects/qat/vision/modeling/layers/nn_blocks.py:837 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/745842060be62f98. Report an issue: GitHub.