fix(bigvgan-trainer): clone target tensor to exit inference mode before backward
Clips loaded outside torch.inference_mode(False) are inference tensors. Autograd cannot save them for backward. .clone() creates a normal tensor, same fix pattern as selva_lora_trainer's dist.mode().clone(). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -232,7 +232,7 @@ class SelvaBigvganTrainer:
|
||||
start = random.randint(0, clip.shape[0] - segment_samples)
|
||||
batch.append(clip[start : start + segment_samples])
|
||||
|
||||
target_flat = torch.stack(batch).to(device, dtype) # [B, T]
|
||||
target_flat = torch.stack(batch).to(device, dtype).clone() # [B, T]
|
||||
target_wav = target_flat.unsqueeze(1) # [B, 1, T]
|
||||
|
||||
# Fixed target mel (no grad needed here)
|
||||
|
||||
Reference in New Issue
Block a user