musikalkemist/pytorchforaudio

Trouble with urbansounddataset

roilhi opened this issue · 2 comments

roilhi commented

I'm getting the following error when running the urbansounddataset.py file:
resampled = torch.nn.functional.conv1d(waveform[:, None], kernel, stride=orig_freq)
RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same. I've tried to figure out why by checking my variables, but i'm just struggling with that. Do you have any idea? I'm using windows, and torch 1.13.0+cu117.

It seems this is caused by not having both tensors on the same device, you should add the .to(device) to both or remove from both.

@roilhi this is solved in this pull request #6 by adding device to Resampler.