From a079e767dfa9e3d95f5fbdff3d24fc68d5a5e2d3 Mon Sep 17 00:00:00 2001 From: chenfeiyu Date: Fri, 11 Dec 2020 19:45:49 +0800 Subject: [PATCH] add set_device at experiment setup --- parakeet/models/waveflow.py | 2 +- parakeet/training/experiment.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/parakeet/models/waveflow.py b/parakeet/models/waveflow.py index c722e03..5398b22 100644 --- a/parakeet/models/waveflow.py +++ b/parakeet/models/waveflow.py @@ -488,7 +488,7 @@ class ConditionalWaveFlow(nn.LayerList): z, log_det_jacobian = self.decoder(audio, condition) return z, log_det_jacobian - @paddle.fluid.dygraph.no_grad + @paddle.no_grad() def synthesize(self, mel): condition = self.encoder(mel, trim_conv_artifact=True) #(B, C, T) batch_size, _, time_steps = condition.shape diff --git a/parakeet/training/experiment.py b/parakeet/training/experiment.py index 9804d4c..e771b55 100644 --- a/parakeet/training/experiment.py +++ b/parakeet/training/experiment.py @@ -59,6 +59,7 @@ class ExperimentBase(object): self.args = args def setup(self): + paddle.set_device(self.args.device) if self.parallel: self.init_parallel()