{"record":{"id":"67a3082d74018692","repo":"tensorflow/models","slug":"number-of-elements-in-temporal-kernel-sizes-must","errorCode":null,"errorMessage":"Number of elements in `temporal_kernel_sizes` must equal to `block_repeats`.","messagePattern":"Number of elements in `temporal_kernel_sizes` must equal to `block_repeats`\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/modeling/backbones/resnet_3d.py","lineNumber":325,"sourceCode":"      temporal_kernel_sizes: A tuple that specifies the temporal kernel sizes\n        for each block in the current group.\n      temporal_strides: An `int` of temporal strides for the first convolution\n        in this group.\n      spatial_strides: An `int` stride to use for the first convolution of the\n        layer. If greater than 1, this layer will downsample the input.\n      block_fn: Either `nn_blocks.ResidualBlock` or `nn_blocks.BottleneckBlock`.\n      block_repeats: An `int` of number of blocks contained in the layer.\n      stochastic_depth_drop_rate: A `float` of drop rate of the current block\n        group.\n      use_self_gating: A `bool` that specifies whether to apply self-gating\n        module or not.\n      name: A `str` name for the block.\n\n    Returns:\n      The output `tf.Tensor` of the block layer.\n    \"\"\"\n    if len(temporal_kernel_sizes) != block_repeats:\n      raise ValueError(\n          'Number of elements in `temporal_kernel_sizes` must equal to `block_repeats`.'\n      )\n\n    # Only apply self-gating module in the last block.\n    use_self_gating_list = [False] * (block_repeats - 1) + [use_self_gating]\n\n    x = block_fn(\n        filters=filters,\n        temporal_kernel_size=temporal_kernel_sizes[0],\n        temporal_strides=temporal_strides,\n        spatial_strides=spatial_strides,\n        stochastic_depth_drop_rate=stochastic_depth_drop_rate,\n        use_self_gating=use_self_gating_list[0],\n        se_ratio=self._se_ratio,\n        kernel_initializer=self._kernel_initializer,\n        kernel_regularizer=self._kernel_regularizer,\n        bias_regularizer=self._bias_regularizer,\n        activation=self._activation,","sourceCodeStart":307,"sourceCodeEnd":343,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/modeling/backbones/resnet_3d.py#L307-L343","documentation":"Error \"Number of elements in `temporal_kernel_sizes` must equal to `block_repeats`.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/modeling/backbones/resnet_3d.py:325 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set temporal_kernel_sizes to a list whose length equals block_repeats for that stage.","Provide one temporal kernel size per repeated block, or None to use the default."],"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"}