{"record":{"id":"57fe5b98af13a4ef","repo":"open-mmlab/mmdetection","slug":"please-run-pip-install-instaboostfast-to-install","errorCode":null,"errorMessage":"Please run \"pip install instaboostfast\" to install instaboostfast first for instaboost augmentation.","messagePattern":"Please run \"pip install instaboostfast\" to install instaboostfast first for instaboost augmentation\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"mmdet/datasets/transforms/instaboost.py","lineNumber":67,"sourceCode":"    def __init__(self,\n                 action_candidate: tuple = ('normal', 'horizontal', 'skip'),\n                 action_prob: tuple = (1, 0, 0),\n                 scale: tuple = (0.8, 1.2),\n                 dx: int = 15,\n                 dy: int = 15,\n                 theta: tuple = (-1, 1),\n                 color_prob: float = 0.5,\n                 hflag: bool = False,\n                 aug_ratio: float = 0.5) -> None:\n\n        import matplotlib\n        import matplotlib.pyplot as plt\n        default_backend = plt.get_backend()\n\n        try:\n            import instaboostfast as instaboost\n        except ImportError:\n            raise ImportError(\n                'Please run \"pip install instaboostfast\" '\n                'to install instaboostfast first for instaboost augmentation.')\n\n        # instaboost will modify the default backend\n        # and cause visualization to fail.\n        matplotlib.use(default_backend)\n\n        self.cfg = instaboost.InstaBoostConfig(action_candidate, action_prob,\n                                               scale, dx, dy, theta,\n                                               color_prob, hflag)\n        self.aug_ratio = aug_ratio\n\n    def _load_anns(self, results: dict) -> Tuple[list, list]:\n        \"\"\"Convert raw anns to instaboost expected input format.\"\"\"\n        anns = []\n        ignore_anns = []\n        for instance in results['instances']:\n            label = instance['bbox_label']","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/mmdet/datasets/transforms/instaboost.py#L49-L85","documentation":"MMDetection's InstaBoost transform requires the third-party `instaboostfast` package. The __init__ of InstaBoost tries to import it and raises ImportError with install instructions if the package is missing. instaboostfast itself is not pip-installable from PyPI in some versions and may need to be built from source.","triggerScenarios":"Instantiating the InstaBoost transform (e.g. via a pipeline config containing dict(type='InstaBoost', ...)) in an environment where `import instaboostfast` fails because the package is not installed or its compiled dependencies are missing.","commonSituations":"Using old mmdet configs that relied on InstaBoost augmentation; fresh conda/venv environments; instaboostfast failing to build against a new numpy/opencv version; copying a training pipeline from a repo that used instaboost.","solutions":["pip install instaboostfast (from PyPI if available)","If PyPI install/build fails, clone https://github.com/albumentations-team/instaboostfast and install from source, ensuring numpy/opencv/python headers are available","If you don't need the augmentation, remove dict(type='InstaBoost', ...) from the train pipeline in your config"],"exampleFix":"// before (config pipeline)\ntrain_pipeline=[dict(type='InstaBoost', aug_prob=0.5)]\n// after\ntrain_pipeline=[dict(type='RandomFlip', prob=0.5)]","handlingStrategy":"validation","validationCode":"import importlib.util\nif importlib.util.find_spec('instaboostfast') is None:\n    # skip InstaBoost or install before training\n    pass","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check optional deps with importlib.util.find_spec before building the pipeline","Keep an environment.yml listing augmentation extras like instaboostfast"],"tags":["mmdetection","instaboost","missing-dependency","augmentation","importerror"],"backgroundTag":"missing-optional-dependency","analyzedSha":"cfd5d3a985b0249de009b67d04f37263e11cdf3d","analyzedAt":"2026-08-27T20:54:20.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}