{"record":{"id":"27dfb92773ad05e8","repo":"open-mmlab/mmdetection","slug":"forward-function-namely-tensor-mode-is-not-su","errorCode":null,"errorMessage":"_forward function (namely 'tensor' mode) is not supported now","messagePattern":"_forward function \\(namely 'tensor' mode\\) is not supported now","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"mmdet/models/mot/base.py","lineNumber":146,"sourceCode":"        pass\n\n    def _forward(self,\n                 inputs: Dict[str, Tensor],\n                 data_samples: OptTrackSampleList = None,\n                 **kwargs):\n        \"\"\"Network forward process. Usually includes backbone, neck and head\n        forward without any post-processing.\n\n         Args:\n            inputs (Dict[str, Tensor]): of shape (N, T, C, H, W).\n            data_samples (List[:obj:`TrackDataSample`], optional): The\n                Data Samples. It usually includes information such as\n                `gt_instance`.\n\n        Returns:\n            tuple[list]: A tuple of features from ``head`` forward.\n        \"\"\"\n        raise NotImplementedError(\n            \"_forward function (namely 'tensor' mode) is not supported now\")\n","sourceCodeStart":128,"sourceCodeEnd":148,"githubUrl":"https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/mmdet/models/mot/base.py#L128-L148","documentation":"BaseMot deliberately does not implement _forward (tensor mode); MOT models only support loss and predict. Any forward call with mode='tensor' hits this NotImplementedError.","triggerScenarios":"Calling model(inputs, data_samples, mode='tensor') on a MOT model, or tooling (e.g. export scripts, ONNX tools, feature extraction) that defaults to tensor mode.","commonSituations":"Trying to export a tracking model to ONNX/TensorRT; using extract-feat style scripts from 1.x mmdet; generic wrappers that call _forward directly.","solutions":["Use mode='predict' instead of mode='tensor' for inference","For feature extraction or deployment, use the underlying detector submodule directly (e.g. model.detector) rather than the MOT wrapper"],"exampleFix":"# before\nfeats = model(imgs, mode='tensor')\n# after\nresults = model(imgs, data_samples, mode='predict')","handlingStrategy":"validation","validationCode":"from mmdet.models.mot.base import BaseMot\nif isinstance(model, BaseSort):  # SORT family supports only loss/predict\n    assert mode != 'tensor'","typeGuard":"def supports_tensor_mode(model) -> bool: return not isinstance(getattr(model, 'loss', None).__self__, __import__('mmdet.models.mot', fromlist=['base']).BaseSort)","tryCatchPattern":null,"preventionTips":["Avoid mode='tensor' on MOT/tracking models","For deployment, target the detector submodule directly"],"tags":["mmdetection","mot","not-implemented"],"backgroundTag":"unsupported-operation-mode","analyzedSha":"cfd5d3a985b0249de009b67d04f37263e11cdf3d","analyzedAt":"2026-08-27T20:54:20.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}