{"record":{"id":"ca87d6204eb301db","repo":"tensorflow/models","slug":"number-of-blocks-in-temporal-specs-should-equal-to-ca87d6","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/vision/modeling/backbones/resnet_3d.py","lineNumber":185,"sourceCode":"      inputs: the keras input spec.\n\n    Returns:\n      endpoints: A dictionary of backbone endpoint features.\n    \"\"\"\n    # Build stem.\n    x = 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    x = layers.MaxPool3D(\n        pool_size=[temporal_kernel_size, 3, 3],\n        strides=[self._stem_pool_temporal_stride, 2, 2],\n        padding='same')(x)\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    endpoints = {}\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      x = self._block_group(\n          inputs=x,\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":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/modeling/backbones/resnet_3d.py#L167-L203","documentation":"Error \"Number of blocks in temporal specs should equal to resnet_specs.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/modeling/backbones/resnet_3d.py:185 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Give temporal_specs the same number of stage entries as resnet_specs (one per ResNet stage).","Leave temporal_specs as None if no temporal modeling is needed."],"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"}