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