Skip to content

Commit 2b557d4

Browse files
PetrochukMr9y9
authored andcommitted
Train Frame Clip (#70)
* Lengths Input lengths is the length of the audio clip; therefore, it does not make sense to clip the spectrogram a length like 10000. We need to scale the length down by ``audio.get_hop_size()``. * Fix Division * Comments * Update train.py
1 parent 01d5569 commit 2b557d4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

train.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,10 @@ def eval_model(global_step, writer, device, model, y, c, g, input_lengths, eval_
492492
y_target = y[idx].view(-1).data.cpu().numpy()[:length]
493493

494494
if c is not None:
495-
c = c[idx, :, :length].unsqueeze(0)
495+
if hparams.upsample_conditional_features:
496+
c = c[idx, :, :length // audio.get_hop_size()].unsqueeze(0)
497+
else:
498+
c = c[idx, :, :length].unsqueeze(0)
496499
assert c.dim() == 3
497500
print("Shape of local conditioning features: {}".format(c.size()))
498501
if g is not None:

0 commit comments

Comments
 (0)