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

Warning from LVIS v1 dataset load_data_list: the installed `lvis` package looks like the deprecated 'mmlvis' fork (version >= '10.5.3' heuristic), and official lvis-api is recommended instead.

Source

Thrown at mmdet/datasets/lvis.py:282

         'wig', 'wind_chime', 'windmill', 'window_box_(for_plants)',
         'windshield_wiper', 'windsock', 'wine_bottle', 'wine_bucket',
         'wineglass', 'wing_chair', 'blinder_(for_horses)', 'wok', 'wolf',
         'wooden_spoon', 'wreath', 'wrench', 'wristband', 'wristlet', 'yacht',
         'yak', 'yogurt', 'yoke_(animal_equipment)', 'zebra', 'zucchini'),
        'palette':
        None
    }

    def load_data_list(self) -> List[dict]:
        """Load annotations from an annotation file named as ``self.ann_file``

        Returns:
            List[dict]: A list of annotation.
        """  # noqa: E501
        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
        except ImportError:
            raise ImportError(
                'Package lvis is not installed. Please run "pip install git+https://github.com/lvis-dataset/lvis-api.git".'  # noqa: E501
            )
        with get_local_path(
                self.ann_file, backend_args=self.backend_args) as local_path:
            self.lvis = LVIS(local_path)
        self.cat_ids = self.lvis.get_cat_ids()
        self.cat2label = {cat_id: i for i, cat_id in enumerate(self.cat_ids)}
        self.cat_img_map = copy.deepcopy(self.lvis.cat_img_map)

        img_ids = self.lvis.get_img_ids()
        data_list = []
        total_ann_ids = []
        for img_id in img_ids:

View on GitHub (pinned to cfd5d3a985)

Solutions

  1. pip uninstall mmlvis && pip install git+https://github.com/lvis-dataset/lvis-api.git
  2. Reinstall from updated mmdet extra requirements

Example fix

# before
pip install mmlvis
# after
pip uninstall mmlvis
pip install git+https://github.com/lvis-dataset/lvis-api.git
Defensive patterns

Strategy: validation

Validate before calling

import lvis
if getattr(lvis, '__version__', '0') >= '10.5.3':
    print('mmlvis fork detected; install official lvis-api')

Try / catch

import warnings
with warnings.catch_warnings():
    warnings.filterwarnings('ignore', message='mmlvis is deprecated')
    from mmdet.datasets.lvis import LVISV1Dataset

Prevention

When it happens

Trigger: Building LVISV05Dataset/LVISV1Dataset when the mmlvis fork (with inflated 10.x version) provides the `lvis` module.

Common situations: Legacy mmdet 2.x envs that installed mmlvis; fork diverges from official lvis-api and can break evaluation.

Related errors


AI-assisted analysis of open-mmlab/mmdetection@cfd5d3a985 (2026-08-27). Data as JSON: /api/errors/8da5fa57dea56b5e. Report an issue: GitHub.