{"record":{"id":"15b380ad4afc952c","repo":"open-mmlab/mmdetection","slug":"the-show-is-true-it-means-that-only-the-predictio","errorCode":null,"errorMessage":"The show is True, it means that only the prediction results are visualized without storing data, so vis_backends needs to be excluded.","messagePattern":"The show is True, it means that only the prediction results are visualized without storing data, so vis_backends needs to be excluded\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"mmdet/engine/hooks/visualization_hook.py","lineNumber":68,"sourceCode":"            corresponding backend. Defaults to None.\n    \"\"\"\n\n    def __init__(self,\n                 draw: bool = False,\n                 interval: int = 50,\n                 score_thr: float = 0.3,\n                 show: bool = False,\n                 wait_time: float = 0.,\n                 test_out_dir: Optional[str] = None,\n                 backend_args: dict = None):\n        self._visualizer: Visualizer = Visualizer.get_current_instance()\n        self.interval = interval\n        self.score_thr = score_thr\n        self.show = show\n        if self.show:\n            # No need to think about vis backends.\n            self._visualizer._vis_backends = {}\n            warnings.warn('The show is True, it means that only '\n                          'the prediction results are visualized '\n                          'without storing data, so vis_backends '\n                          'needs to be excluded.')\n\n        self.wait_time = wait_time\n        self.backend_args = backend_args\n        self.draw = draw\n        self.test_out_dir = test_out_dir\n        self._test_index = 0\n\n    def after_val_iter(self, runner: Runner, batch_idx: int, data_batch: dict,\n                       outputs: Sequence[DetDataSample]) -> None:\n        \"\"\"Run after every ``self.interval`` validation iterations.\n\n        Args:\n            runner (:obj:`Runner`): The runner of the validation process.\n            batch_idx (int): The index of the current batch in the val loop.\n            data_batch (dict): Data from dataloader.","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/mmdet/engine/hooks/visualization_hook.py#L50-L86","documentation":"Warning from DetVisualizationHook.__init__: when show=True, the hook clears the visualizer's vis_backends (no writing to disk/local storage) because showing implies interactive display only.","triggerScenarios":"Configuring custom_hooks=[dict(type='DetVisualizationHook', show=True)] (or visualization=True + show=True in train cfg); all vis backends are dropped at hook init.","commonSituations":"Debugging on a display machine while config still lists Tensorboard/Local vis_backends; users wonder why no viz files appear during training.","solutions":["Set show=False if you want vis_backends to store images","Remove show=True and rely on vis_backends for offline inspection","If you want both, run twice or accept that show mode is display-only"],"exampleFix":"# before\ncustom_hooks = [dict(type='DetVisualizationHook', show=True)]\n# after\ncustom_hooks = [dict(type='DetVisualizationHook', show=False)]","handlingStrategy":"validation","validationCode":"if hook_cfg.get('show', False):\n    assert not want_vis_backends, 'show=True disables all vis_backends'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never expect stored visualizations while show=True","Use show only for interactive debugging sessions"],"tags":["python","warning","visualization","hook","show-mode"],"backgroundTag":"mutually-exclusive-options","analyzedSha":"cfd5d3a985b0249de009b67d04f37263e11cdf3d","analyzedAt":"2026-08-27T20:54:20.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}