open-mmlab/mmdetection · warning
mmlvis is deprecated, please install official lvis-api by "p
Error message
mmlvis is deprecated, please install official lvis-api by "pip install git+https://github.com/lvis-dataset/lvis-api.git"
What it means
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.
Source
Thrown at mmdet/evaluation/metrics/lvis_metric.py:29
import torch
from mmengine.dist import (all_gather_object, broadcast_object_list,
is_main_process)
from mmengine.evaluator import BaseMetric
from mmengine.evaluator.metric import _to_cpu
from mmengine.fileio import get_local_path
from mmengine.logging import MMLogger, print_log
from terminaltables import AsciiTable
from mmdet.registry import METRICS
from mmdet.structures.mask import encode_mask_results
from ..functional import eval_recalls
from .coco_metric import CocoMetric
try:
import lvis
if getattr(lvis, '__version__', '0') >= '10.5.3':
warnings.warn(
'mmlvis is deprecated, please install official lvis-api by "pip install git+https://github.com/lvis-dataset/lvis-api.git"', # noqa: E501
UserWarning)
from lvis import LVIS, LVISEval, LVISResults
except ImportError:
lvis = None
LVISEval = None
LVISResults = None
@METRICS.register_module()
class LVISMetric(CocoMetric):
"""LVIS evaluation metric.
Args:
ann_file (str, optional): Path to the coco format annotation file.
If not specified, ground truth annotations from the dataset will
be converted to coco format. Defaults to None.
metric (str | List[str]): Metrics to be evaluated. Valid metricsView on GitHub (pinned to cfd5d3a985)
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
Example fix
# before pip install mmlvis # after pip uninstall -y mmlvis lvis pip install git+https://github.com/lvis-dataset/lvis-api.git
Defensive patterns
Strategy: validation
Validate before calling
import lvis official = getattr(lvis, '__version__', '0') < '10.5.3' assert official, 'mmlvis fork detected; install official lvis-api'
Prevention
- 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
When it happens
Trigger: Importing mmdet.evaluation.metrics.LVISMetric (or a config using it) while the deprecated 'mmlvis' fork package named lvis is installed.
Common situations: 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.
Related errors
- imagecorruptions is not installed
- albumentations is not installed
- Package lvis is not installed. Please run "pip install git+h
- {metric} is not in results
- metric item "{metric_item}" is not supported
AI-assisted analysis of open-mmlab/mmdetection@cfd5d3a985 (2026-08-27).
Data as JSON: /api/errors/87cca4f3060d90fa.
Report an issue: GitHub.