asteroid-team / torch-audiomentations

Fast audio data augmentation in PyTorch. Inspired by audiomentations. Useful for deep learning.
MIT License
928 stars 87 forks source link

[Bug] RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu #137

Closed ahikaml closed 2 years ago

ahikaml commented 2 years ago

Hi, It happens in band_pass_filter.py _bandwidthdist is allocated on the CPU (ln 101-103) while _centerdist (ln96-98) is allocated on the GPU. I think that it can be solved by using the device info of _selectedsamples for _bandwidthdist .

iver56 commented 2 years ago

Ok, yeah, that should be fixed. I'll see if I can patch it real quick

iver56 commented 2 years ago

https://github.com/asteroid-team/torch-audiomentations/pull/138