fix: move baseline sample after inference flag stripping

_save_sample("baseline") was called before the vocoder's inference
tensors were sanitized, causing "Inference tensors do not track version
counter". Moved it after the clone/detach loop and vocoder.to(device).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-10 01:26:11 +02:00
parent f8d4d77b0d
commit 5a2c003fb2
+3 -2
View File
@@ -951,8 +951,6 @@ def _do_train(vocoder, mel_converter, clips,
except Exception as e: except Exception as e:
print(f"[BigVGAN] Sample save failed ({label}): {e}", flush=True) print(f"[BigVGAN] Sample save failed ({label}): {e}", flush=True)
_save_sample("baseline")
# Sanitize all inference tensors in the vocoder. # Sanitize all inference tensors in the vocoder.
# Three categories to handle (all loaded in ComfyUI's inference_mode): # Three categories to handle (all loaded in ComfyUI's inference_mode):
# #
@@ -994,6 +992,9 @@ def _do_train(vocoder, mel_converter, clips,
# After cloning, vocoder may be on CPU (offloaded before training). # After cloning, vocoder may be on CPU (offloaded before training).
vocoder.to(device, dtype) vocoder.to(device, dtype)
# Baseline sample — after sanitization so vocoder has normal tensors.
_save_sample("baseline")
# ── GAFilter injection ───────────────────────────────────────────────── # ── GAFilter injection ─────────────────────────────────────────────────
# GAFilter params are fresh tensors — no inference flag to strip. # GAFilter params are fresh tensors — no inference flag to strip.
if use_gafilter: if use_gafilter: