{"record":{"id":"2e2bcc9c38f819bf","repo":"tensorflow/models","slug":"number-of-elements-in-temporal-kernel-sizes-must-e","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/projects/const_cl/modeling/backbones/resnet_3d.py","lineNumber":260,"sourceCode":"        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    del inputs\n    if len(temporal_kernel_sizes) != block_repeats:\n      raise ValueError(\n          'Number of elements in temporal_kernel_sizes must equal to '\n          'block_repeats.')\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    name = 'cell'\n    block_layers = {}\n    block_layers[f'{name}_0'] = 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,","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/const_cl/modeling/backbones/resnet_3d.py#L242-L278","documentation":"Error \"Number of elements in temporal_kernel_sizes must equal to block_repeats.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/const_cl/modeling/backbones/resnet_3d.py:260 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"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"}