{"record":{"id":"26ccd7b33f9862a1","repo":"Stability-AI/generative-models","slug":"checkpoint-path-is-deprecated-use-checkpoint-egn","errorCode":null,"errorMessage":"Checkpoint path is deprecated, use `checkpoint_egnine` instead","messagePattern":"Checkpoint path is deprecated, use `checkpoint_egnine` instead","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"sgm/models/autoencoder.py","lineNumber":166,"sourceCode":"                [{} for _ in range(len(self.trainable_ae_params))],\n            )\n            assert len(self.ae_optimizer_args) == len(self.trainable_ae_params)\n        else:\n            self.ae_optimizer_args = [{}]  # makes type consitent\n\n        self.trainable_disc_params = trainable_disc_params\n        if self.trainable_disc_params is not None:\n            self.disc_optimizer_args = default(\n                disc_optimizer_args,\n                [{} for _ in range(len(self.trainable_disc_params))],\n            )\n            assert len(self.disc_optimizer_args) == len(self.trainable_disc_params)\n        else:\n            self.disc_optimizer_args = [{}]  # makes type consitent\n\n        if ckpt_path is not None:\n            assert ckpt_engine is None, \"Can't set ckpt_engine and ckpt_path\"\n            logpy.warn(\"Checkpoint path is deprecated, use `checkpoint_egnine` instead\")\n        self.apply_ckpt(default(ckpt_path, ckpt_engine))\n        self.additional_decode_keys = set(default(additional_decode_keys, []))\n\n    def get_input(self, batch: Dict) -> torch.Tensor:\n        # assuming unified data format, dataloader returns a dict.\n        # image tensors should be scaled to -1 ... 1 and in channels-first\n        # format (e.g., bchw instead if bhwc)\n        return batch[self.input_key]\n\n    def get_autoencoder_params(self) -> list:\n        params = []\n        if hasattr(self.loss, \"get_trainable_autoencoder_parameters\"):\n            params += list(self.loss.get_trainable_autoencoder_parameters())\n        if hasattr(self.regularization, \"get_trainable_parameters\"):\n            params += list(self.regularization.get_trainable_parameters())\n        params = params + list(self.encoder.parameters())\n        params = params + list(self.decoder.parameters())\n        return params","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/Stability-AI/generative-models/blob/e8cd657656fa5d61688191730d0e03242bf4ed44/sgm/models/autoencoder.py#L148-L184","documentation":"AutoencodingLayer / AutoencoderKL-style __init__ warns that passing a ckpt_path string is deprecated in favor of a checkpoint_engine object (Lightning's checkpoint engine abstraction). It is a warning, not a raise: the path is still applied via apply_ckpt, but asserts that ckpt_engine is not also set.","triggerScenarios":"Instantiating an autoencoder model from config with `params: {ckpt_path: 'path/to/ckpt'}` while ckpt_engine is None — typical after upgrading sgm/Stable Diffusion code to a Lightning 2.x-style checkpointing API.","commonSituations":"Old YAML configs (SD 2.x era) reused with newer code; migrating from pl Lightning 'ckpt_path' conventions to 'checkpoint_egnine' (note the code's own typo) engines.","solutions":["Replace ckpt_path with a checkpoint_engine in the model config","Keep ckpt_path if you accept the deprecation warning (behavior still works)","Load the checkpoint manually after model construction with model.load_state_dict(torch.load(path)['state_dict'], strict=False)"],"exampleFix":"// before\nmodel = AutoencoderKL(..., ckpt_path=\"ae.ckpt\")\n// after\nfrom pytorch_lightning.futilities import ...\nmodel = AutoencoderKL(..., ckpt_engine=my_checkpoint_engine)","handlingStrategy":"validation","validationCode":"params = cfg[\"params\"]\nif \"ckpt_path\" in params:\n    assert \"ckpt_engine\" not in params, \"set only one of ckpt_path/ckpt_engine\"\n    warnings.warn(\"migrate ckpt_path -> checkpoint_engine\")","typeGuard":"def uses_deprecated_ckpt(params: dict) -> bool:\n    return \"ckpt_path\" in params and \"ckpt_engine\" not in params","tryCatchPattern":"try:\n    model = instantiate_from_config(config)\nexcept AssertionError as e:\n    if \"ckpt_engine\" in str(e):\n        config[\"params\"].pop(\"ckpt_path\")\n        model = instantiate_from_config(config)","preventionTips":["Migrate configs to checkpoint_engine","Never set both ckpt_path and ckpt_engine","Grep configs for 'ckpt_path' in CI and warn"],"tags":["python","deprecation","pytorch-lightning","config"],"backgroundTag":"deprecated-api-parameter","analyzedSha":"e8cd657656fa5d61688191730d0e03242bf4ed44","analyzedAt":"2026-08-29T11:23:43.234Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}