{"record":{"id":"87cca4f3060d90fa","repo":"open-mmlab/mmdetection","slug":"mmlvis-is-deprecated-please-install-official-lvis-87cca4","errorCode":null,"errorMessage":"mmlvis is deprecated, please install official lvis-api by \"pip install git+https://github.com/lvis-dataset/lvis-api.git\"","messagePattern":"mmlvis is deprecated, please install official lvis-api by \"pip install git\\+https://github\\.com/lvis-dataset/lvis-api\\.git\"","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"mmdet/evaluation/metrics/lvis_metric.py","lineNumber":29,"sourceCode":"import torch\nfrom mmengine.dist import (all_gather_object, broadcast_object_list,\n                           is_main_process)\nfrom mmengine.evaluator import BaseMetric\nfrom mmengine.evaluator.metric import _to_cpu\nfrom mmengine.fileio import get_local_path\nfrom mmengine.logging import MMLogger, print_log\nfrom terminaltables import AsciiTable\n\nfrom mmdet.registry import METRICS\nfrom mmdet.structures.mask import encode_mask_results\nfrom ..functional import eval_recalls\nfrom .coco_metric import CocoMetric\n\ntry:\n    import lvis\n\n    if getattr(lvis, '__version__', '0') >= '10.5.3':\n        warnings.warn(\n            'mmlvis is deprecated, please install official lvis-api by \"pip install git+https://github.com/lvis-dataset/lvis-api.git\"',  # noqa: E501\n            UserWarning)\n    from lvis import LVIS, LVISEval, LVISResults\nexcept ImportError:\n    lvis = None\n    LVISEval = None\n    LVISResults = None\n\n\n@METRICS.register_module()\nclass LVISMetric(CocoMetric):\n    \"\"\"LVIS evaluation metric.\n\n    Args:\n        ann_file (str, optional): Path to the coco format annotation file.\n            If not specified, ground truth annotations from the dataset will\n            be converted to coco format. Defaults to None.\n        metric (str | List[str]): Metrics to be evaluated. Valid metrics","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/mmdet/evaluation/metrics/lvis_metric.py#L11-L47","documentation":"Import-time warning from lvis_metric.py: the installed 'lvis' package is an old mmlvis fork (version >= '10.5.3' string-compare detects it). MMDetection wants the official LVIS API from the lvis-dataset GitHub repo instead.","triggerScenarios":"Importing mmdet.evaluation.metrics.LVISMetric (or a config using it) while the deprecated 'mmlvis' fork package named lvis is installed.","commonSituations":"Environments where pip install mmlvis (or an old requirements pin) provided the lvis module; the mmlvis fork lacks features of the official API and may mis-evaluate.","solutions":["pip uninstall lvis mmlvis, then pip install git+https://github.com/lvis-dataset/lvis-api.git","Pin the official lvis-api in your requirements to avoid the fork creeping back","Verify with python -c \"import lvis; print(lvis.__version__)\" and check import no longer warns"],"exampleFix":"# before\npip install mmlvis\n# after\npip uninstall -y mmlvis lvis\npip install git+https://github.com/lvis-dataset/lvis-api.git","handlingStrategy":"validation","validationCode":"import lvis\nofficial = getattr(lvis, '__version__', '0') < '10.5.3'\nassert official, 'mmlvis fork detected; install official lvis-api'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin git+https://github.com/lvis-dataset/lvis-api.git in requirements","Uninstall mmlvis forks in CI images","Add an import-time check in CI for the deprecation warning"],"tags":["mmdet","lvis","deprecated-package","dependency","evaluation"],"backgroundTag":"deprecated-package-version","analyzedSha":"cfd5d3a985b0249de009b67d04f37263e11cdf3d","analyzedAt":"2026-08-27T20:54:20.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}