From cffec7e018247efd76420e8b7bf024e411a6f60e Mon Sep 17 00:00:00 2001 From: Yearat Hossain Date: Fri, 31 Dec 2021 11:01:08 +0600 Subject: [PATCH] Update urbansounddataset.py --- 10 Predictions with sound classifier/urbansounddataset.py | 1 + 1 file changed, 1 insertion(+) diff --git a/10 Predictions with sound classifier/urbansounddataset.py b/10 Predictions with sound classifier/urbansounddataset.py index 132d209..9e17527 100644 --- a/10 Predictions with sound classifier/urbansounddataset.py +++ b/10 Predictions with sound classifier/urbansounddataset.py @@ -53,6 +53,7 @@ def _right_pad_if_necessary(self, signal): def _resample_if_necessary(self, signal, sr): if sr != self.target_sample_rate: resampler = torchaudio.transforms.Resample(sr, self.target_sample_rate) + resampler = resampler.to(self.device) # Does not work if not brought to device signal = resampler(signal) return signal