From 7c5e98dfb3a93cb93a83b77127e1bee9977afae6 Mon Sep 17 00:00:00 2001 From: chenfeiyu Date: Mon, 11 Jan 2021 17:24:46 +0800 Subject: [PATCH] fix a bug when using a method other than forward with DataParallel --- examples/wavenet/train.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/wavenet/train.py b/examples/wavenet/train.py index 51d000a..b62e4a3 100644 --- a/examples/wavenet/train.py +++ b/examples/wavenet/train.py @@ -119,7 +119,7 @@ class Experiment(ExperimentBase): mel, wav, audio_starts = batch y = self.model(wav, mel, audio_starts) - loss = self.model.loss(y, wav) + loss = self.model_core.loss(y, wav) loss.backward() self.optimizer.step() iteration_time = time.time() - start @@ -141,7 +141,7 @@ class Experiment(ExperimentBase): valid_losses = [] mel, wav, audio_starts = next(valid_iterator) y = self.model(wav, mel, audio_starts) - loss = self.model.loss(y, wav) + loss = self.model_core.loss(y, wav) valid_losses.append(float(loss)) valid_loss = np.mean(valid_losses) self.visualizer.add_scalar(