Skip to content

Commit

Permalink
fix trainer infer error
Browse files Browse the repository at this point in the history
  • Loading branch information
yoyolicoris authored Jul 14, 2020
1 parent b2431e0 commit d727692
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ def train(self):

if type(self.model) is nn.DataParallel:
sr = self.model.module.sr
x = self.model.module.infer(mels[0], z[0].std().item())
x = self.model.module.infer(mels[0], z[0].std().item())[0]
else:
sr = self.model.sr
x = self.model.infer(mels[0], z[0].std().item())
x = self.model.infer(mels[0], z[0].std().item())[0]
torch.clamp(x, -1, 1, out=x)
self.writer.add_audio('reconstruct_audio', x.cpu()[None, :], sample_rate=sr)

Expand Down

0 comments on commit d727692

Please sign in to comment.