{"record":{"id":"ca40c2a7178333b8","repo":"tensorflow/models","slug":"expected-features-is-a-rank-5-tensor-got-shape-s-ca40c2","errorCode":null,"errorMessage":"Expected features is a rank-5 tensor. Got shape %s","messagePattern":"Expected features is a rank-5 tensor\\. Got shape (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/videoglue/modeling/heads/action_transformer.py","lineNumber":213,"sourceCode":"           inputs: Mapping[str, tf.Tensor],\n           training: bool = False) -> Mapping[str, tf.Tensor]:\n    \"\"\"Forward calls.\n\n    Args:\n      inputs: the inputs dictionary contains\n        'features': the instance embeddings in shape [B, T', H, W, C].\n        'instances_positions': the instance boxes in shape [B, T, N, 4].\n        'instances_mask': the validity mask for each instance position, in\n          [B, T, N].\n      training: whether in training mode.\n\n    Returns:\n      the final action classification.\n    \"\"\"\n    features = inputs['features']\n    instances_position = inputs['instances_position']\n    if features.shape.ndims != 5:\n      raise ValueError('Expected features is a rank-5 tensor. Got shape %s' %\n                       features.shape)\n\n    if self._use_positional_embedding:\n      features = self._add_positional_embedding(features)\n\n    # Perform RoI-pooling.\n    h, w = _get_shape(features)[2:4]\n    roi_features = {'0': tf.reduce_mean(features, axis=1)}\n    unnormalized_boxes = instances_position * tf.convert_to_tensor(\n        [h, w, h, w], instances_position.dtype)\n    # roi_features in shape [B, N, h, w, C]\n    roi_features = self._roi_aligner(\n        roi_features, unnormalized_boxes, training=training)\n    # Perform average_pooling on ROI-pooled features.\n    b, n, ch, cw, cc = _get_shape(roi_features)\n    roi_features = tf.reshape(roi_features, [b * n, ch, cw, cc])\n    roi_features = self._max_pooler(roi_features)\n    roi_features = tf.reshape(roi_features, [b, n, cc])","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/videoglue/modeling/heads/action_transformer.py#L195-L231","documentation":"Error \"Expected features is a rank-5 tensor. Got shape %s\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/videoglue/modeling/heads/action_transformer.py:213 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"}