From 4f7aa1cb45a706ce2420696eb5c552da8cd01fa9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Apr 2026 08:32:40 +0000 Subject: [PATCH] Improve fallback decoder error messages Agent-Logs-Url: https://github.com/IBB666/IBB_POSE/sessions/be2c1a27-aacc-43a8-adc6-0bb4dbae296e Co-authored-by: kukulu00 <1170651+kukulu00@users.noreply.github.com> --- models/HeatmapHead.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/models/HeatmapHead.py b/models/HeatmapHead.py index d7140d2..9b10b01 100644 --- a/models/HeatmapHead.py +++ b/models/HeatmapHead.py @@ -237,7 +237,7 @@ class _FallbackHeatmapHead(nn.Module): if test_cfg.get("flip_test", False): raise RuntimeError( "The lightweight fallback heatmap head does not support MMPose flip_test. " - "Install mmpose/mmcv for evaluation workflows." + "Disable flip_test for ComfyUI inference, or install mmpose/mmcv for evaluation workflows." ) batch_heatmaps = self.forward(feats) @@ -265,7 +265,12 @@ class _FallbackHeatmapHead(nn.Module): if key_parts[0] == "final_layer": if len(key_parts) == 3: - idx = int(key_parts[1]) + try: + idx = int(key_parts[1]) + except ValueError as exc: + raise RuntimeError( + f"Incompatible decoder checkpoint key: {key!r}" + ) from exc num_conv_layers = len(self.conv_layers) if isinstance(self.conv_layers, nn.Sequential) else 0 if idx < num_conv_layers: new_key = "conv_layers." + ".".join(key_parts[1:])