{"record":{"id":"0e7a2bfc5d1d79ba","repo":"tensorflow/models","slug":"number-of-blocks-in-temporal-specs-should-equal-to","errorCode":null,"errorMessage":"Number of blocks in temporal specs should equal to resnet_specs.","messagePattern":"Number of blocks in temporal specs should equal to resnet_specs\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/const_cl/modeling/backbones/resnet_3d.py","lineNumber":145,"sourceCode":"      inputs: the Keras input spec.\n\n    Returns:\n      endpoints: A dictionary of backbone endpoint features.\n    \"\"\"\n    # Build stem.\n    self._build_stem(inputs, stem_type=self._stem_type)\n\n    temporal_kernel_size = 1 if self._stem_pool_temporal_stride == 1 else 3\n    self._max_pool = layers.MaxPool3D(\n        pool_size=[temporal_kernel_size, 3, 3],\n        strides=[self._stem_pool_temporal_stride, 2, 2],\n        padding='same')\n\n    # Build intermediate blocks and endpoints.\n    resnet_specs = RESNET_SPECS[self._model_id]\n    if len(self._temporal_strides) != len(resnet_specs) or len(\n        self._temporal_kernel_sizes) != len(resnet_specs):\n      raise ValueError(\n          'Number of blocks in temporal specs should equal to resnet_specs.')\n\n    self._blocks = {}\n    for i, resnet_spec in enumerate(resnet_specs):\n      if resnet_spec[0] == 'bottleneck3d':\n        block_fn = nn_blocks_3d.BottleneckBlock3D\n      else:\n        raise ValueError('Block fn `{}` is not supported.'.format(\n            resnet_spec[0]))\n\n      use_self_gating = (\n          self._use_self_gating[i] if self._use_self_gating else False)\n      self._blocks[f'res_{i+2}'] = self._build_block_group(\n          inputs=inputs,\n          filters=resnet_spec[1],\n          temporal_kernel_sizes=self._temporal_kernel_sizes[i],\n          temporal_strides=self._temporal_strides[i],\n          spatial_strides=(1 if i == 0 else 2),","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/const_cl/modeling/backbones/resnet_3d.py#L127-L163","documentation":"Error \"Number of blocks in temporal specs should equal to resnet_specs.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/const_cl/modeling/backbones/resnet_3d.py:145 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"}