Some bug fixes

pull/10/head
Eren G 2018-07-26 13:33:05 +02:00
parent e156738920
commit 25b6769246
2 changed files with 3 additions and 5 deletions

View File

@ -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

View File

@ -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