{"record":{"id":"f6b7c575559e6dd5","repo":"Lightning-AI/pytorch-lightning","slug":"type-self-name-does-not-support-the-comb","errorCode":null,"errorMessage":"`{type(self).__name__}` does not support the `CombinedLoader(mode=\"sequential\")` mode. The available modes are: {[m for m in _SUPPORTED_MODES if m != 'sequential']}","messagePattern":"`(.+?)` does not support the `CombinedLoader\\(mode=\"sequential\"\\)` mode\\. The available modes are: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/lightning/pytorch/loops/fit_loop.py","lineNumber":472,"sourceCode":"            _set_sampler_epoch(dl, self.epoch_progress.current.processed)\n\n        if not self.restarted_mid_epoch and not self.restarted_on_epoch_end:\n            if not self.restarted_on_epoch_start:\n                self.epoch_progress.increment_ready()\n\n            call._call_callback_hooks(trainer, \"on_train_epoch_start\")\n            call._call_lightning_module_hook(trainer, \"on_train_epoch_start\")\n\n            self.epoch_progress.increment_started()\n\n    def advance(self) -> None:\n        \"\"\"Runs one whole epoch.\"\"\"\n        log.debug(f\"{type(self).__name__}: advancing loop\")\n\n        combined_loader = self._combined_loader\n        assert combined_loader is not None\n        if combined_loader._mode == \"sequential\":\n            raise ValueError(\n                f'`{type(self).__name__}` does not support the `CombinedLoader(mode=\"sequential\")` mode.'\n                f\" The available modes are: {[m for m in _SUPPORTED_MODES if m != 'sequential']}\"\n            )\n        with self.trainer.profiler.profile(\"run_training_epoch\"):\n            assert self._data_fetcher is not None\n            self.epoch_loop.run(self._data_fetcher)\n\n    def on_advance_end(self) -> None:\n        trainer = self.trainer\n        # inform logger the batch loop has finished\n        trainer._logger_connector.epoch_end_reached()\n\n        self.epoch_progress.increment_processed()\n\n        # call train epoch end hooks\n        # we always call callback hooks first, but here we need to make an exception for the callbacks that\n        # monitor a metric, otherwise they wouldn't be able to monitor a key logged in\n        # `LightningModule.on_train_epoch_end`","sourceCodeStart":454,"sourceCodeEnd":490,"githubUrl":"https://github.com/Lightning-AI/pytorch-lightning/blob/9fed5c27d2a62ff0efd6c3573599921d6ff67c14/src/lightning/pytorch/loops/fit_loop.py#L454-L490","documentation":"Raised in FitLoop.advance when the training CombinedLoader was created with mode='sequential'. Sequential mode concatenates multiple dataloaders one after another, which does not produce aligned batches across the epoch and is therefore unsupported for training; only the min_size/max_size/.. cycle-like modes are allowed.","triggerScenarios":"Passing multiple train dataloaders to Trainer.fit and constructing the CombinedLoader (e.g. via LightningDataModule or CombinedLoader directly) with `CombinedLoader(mode='sequential')`, then calling trainer.fit.","commonSituations":"Multi-dataset training setups (e.g. domain adaptation with source/target loaders) where the developer chose sequential mode thinking it cycles; copying a prediction-loop pattern (which does support sequential) into training.","solutions":["Use one of the supported cycling modes: 'min_size', 'max_size', 'max_size_cycle'","If sequential consumption is truly needed, manually chain the datasets into a single ConcatDataset/ConcatLoader and pass one dataloader","If you intended evaluation over multiple loaders, use trainer.validate/test instead, where sequential is allowed"],"exampleFix":"# before\ntrain_loader = CombinedLoader([loader_a, loader_b], mode='sequential')\ntrainer.fit(model, train_loader)\n\n# after\ntrain_loader = CombinedLoader([loader_a, loader_b], mode='max_size_cycle')\ntrainer.fit(model, train_loader)","handlingStrategy":"validation","validationCode":"from lightning.pytorch.utilities import CombinedLoader\nfrom lightning.fabric.utilities import _SUPPORTED_MODES\n\nassert combined.mode != 'sequential', 'training does not support sequential CombinedLoader mode'","typeGuard":"def mode_ok_for_training(mode: str) -> bool:\n    return mode != 'sequential'","tryCatchPattern":null,"preventionTips":["Keep separate CombinedLoader instances for train (cycling modes) and predict (sequential)","Document the mode choice next to multi-dataloader setups in the data module"],"tags":["pytorch-lightning","combined-loader","multi-dataloader","training"],"backgroundTag":"unsupported-loader-mode","analyzedSha":"9fed5c27d2a62ff0efd6c3573599921d6ff67c14","analyzedAt":"2026-08-28T11:52:41.083Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}