mirror of
https://github.com/wassname/TTS.git
synced 2026-09-10 11:50:20 +08:00
Some bug fixes
This commit is contained in:
+1
-2
@@ -305,8 +305,7 @@ class Decoder(nn.Module):
|
||||
if t > inputs.shape[1]/2 and stop_token > 0.6:
|
||||
break
|
||||
elif t > self.max_decoder_steps:
|
||||
print(" !! Decoder stopped with 'max_decoder_steps'. \
|
||||
Something is probably wrong.")
|
||||
print(" | | > Decoder stopped with 'max_decoder_steps")
|
||||
break
|
||||
assert greedy or len(outputs) == T_decoder
|
||||
# Back to batch first
|
||||
|
||||
@@ -301,7 +301,7 @@ def evaluate(model, criterion, criterion_st, data_loader, ap, current_step):
|
||||
# test sentences
|
||||
ap.griffin_lim_iters = 60
|
||||
for idx, test_sentence in enumerate(test_sentences):
|
||||
wav, linear_out, alignments = synthesis(model, ap, test_sentence, use_cuda,
|
||||
wav, linear_spec, alignments = synthesis(model, ap, test_sentence, use_cuda,
|
||||
c.text_cleaner)
|
||||
try:
|
||||
wav_name = 'TestSentences/{}'.format(idx)
|
||||
@@ -310,10 +310,9 @@ def evaluate(model, criterion, criterion_st, data_loader, ap, current_step):
|
||||
except:
|
||||
pass
|
||||
align_img = alignments[0].data.cpu().numpy()
|
||||
linear_spec = linear_output[0].data.cpu().numpy()
|
||||
linear_spec = plot_spectrogram(linear_spec, ap)
|
||||
align_img = plot_alignment(align_img)
|
||||
tb.add_image('TestSentences/{}_GroundTruth'.format(idx), gt_spec, current_step)
|
||||
tb.add_image('TestSentences/{}_Spectrogram'.format(idx), linear_spec, current_step)
|
||||
tb.add_image('TestSentences/{}_Alignment'.format(idx), align_img, current_step)
|
||||
return avg_linear_loss
|
||||
|
||||
|
||||
Reference in New Issue
Block a user