Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device Conversion Bug #174

Closed
nuniz opened this issue Apr 1, 2024 · 0 comments
Closed

Device Conversion Bug #174

nuniz opened this issue Apr 1, 2024 · 0 comments

Comments

@nuniz
Copy link
Contributor

nuniz commented Apr 1, 2024

Hi,
I found a bug when training on a machine with multiple GPUs,

The error:

File "/home/user/microservices/algorithms/ds/augmentations/ops.py", line 59, in forward_transform
  batch = transform(batch)
File "/home/user/virtualenvs/dev/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
  return forward_call(*args, **kwargs)
File "/home/user/microservices/algorithms/ds/augmentations/ops.py", line 33, in forward
  transformed = self.forward_transform(*to_transform, **kwargs)
File "/home/user/microservices/algorithms/ds/augmentations/ops.py", line 220, in forward_transform
  return {'data': self.transform(data)}
File "/home/user/virtualenvs/dev/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
  return forward_call(*args, **kwargs)
File "/home/user/microservices/algorithms/ds/augmentations/ops.py", line 82, in forward
  return super().forward(samples, sample_rate=sample_rate)
File "/home/user/virtualenvs/dev/lib/python3.8/site-packages/torch_audiomentations/core/composition.py", line 120, in forward
  inputs = self.transforms[i](**inputs)
File "/home/user/virtualenvs/dev/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
  return forward_call(*args, **kwargs)
File "/home/user/virtualenvs/dev/lib/python3.8/site-packages/torch_audiomentations/core/transforms_interface.py", line 322, in forward
  selected_samples = cloned_samples[
RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cuda:1)


The bug:

The line should be:
).to(dtype=torch.bool, device=samples.device)

I can open a PR to fix this.

Best,
Asaf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants