From 29b2035513ec365461de5c74f9fb953b1bfc11f3 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 15 Jul 2026 15:56:26 +0000 Subject: [PATCH] Fix CondFromModel loading the config path as its snapshot CondFromModel.__init__ set snapshot_path = Path(config_path), a copy-paste error that overwrote the snapshot path with the config path. When BU conditions were configured the documented way (inference.conditions.config_path + snapshot_path), the model tried to torch.load() the pytorch_config.yaml instead of the .pt snapshot and failed. Use snapshot_path for the snapshot. --- deeplabcut/pose_estimation_pytorch/data/ctd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deeplabcut/pose_estimation_pytorch/data/ctd.py b/deeplabcut/pose_estimation_pytorch/data/ctd.py index 4bb9b46323..5bc5303d71 100644 --- a/deeplabcut/pose_estimation_pytorch/data/ctd.py +++ b/deeplabcut/pose_estimation_pytorch/data/ctd.py @@ -477,7 +477,7 @@ def __init__( ) -> None: if config_path is not None and snapshot_path is not None: config_path = Path(config_path) - snapshot_path = Path(config_path) + snapshot_path = Path(snapshot_path) elif "config" in kwargs and "shuffle" in kwargs: bu_loader, snapshot = self.get_loader_and_snapshot(**kwargs) config_path = bu_loader.model_config_path