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

assertion error: padded_mix.dtype == th.float64 in Separator.separate_tensor method #566

Open
charliemarshall1996 opened this issue Oct 27, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@charliemarshall1996
Copy link

🐛 Bug Report

When calling the separate_tensor method on an instance of the Separator class of the api.py module, with a wav value of a Tensor with a dtype of float32 (as per the method docstring), apply.py raises an assertion error for padded_mix.dtype == th.float64, within the apply_model function. I assumed the padded_mix.dtype should have been the same as the dtype of the input audio, so altered the assertion to be padded_mix.dtype == th.float32. This seemed to then work without issue.

To Reproduce

  1. Synthesize or import audio as Tensor with dtype=torch.float32
  2. Initialize Separator class
  3. Call separate_tensor method with created Tensor object

Expected behavior

separate_tensor would return expected vals.

Actual Behavior

AssertionError raised:

Traceback (most recent call last):
File "path", line 19, in
separator.separate_tensor(reshaped_tensor)
File "path", line 271, in separate_tensor
out = apply_model(
^^^^^^^^^^^^
File "path", line 218, in apply_model
res = apply_model(sub_model, mix, **kwargs, callback_arg=callback_arg)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "path", line 273, in apply_model
res = apply_model(model, shifted, **kwargs, callback_arg=callback_arg)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "path", line 323, in apply_model
chunk_out = future.result() # Get the result from the future.
^^^^^^^^^^^^^^^
File "path", line 131, in result
return self.func(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "path", line 365, in apply_model
assert padded_mix.dtype == th.float64
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Your Environment

  • Python and PyTorch version:
    • py 3.11.4 64-bit
    • torch 2.0.1
  • Operating system and version (desktop or mobile):
    • Windows 11
  • Hardware (gpu or cpu, amount of RAM etc.):
    • cpu: AMD Ryzen 5
    • gpu: NVIDIA GeForce GTX 1650 SUPER
    • RAM: 32 GB
@charliemarshall1996 charliemarshall1996 added the bug Something isn't working label Oct 27, 2023
@CarlGao4
Copy link
Contributor

Please try version 4.1.0a2. 4.1.0a1 has a lot of bugs with API, and I've fixed them in 4.1.0a2, which hasn't been merged. See #552

@charliemarshall1996
Copy link
Author

Perfect. I'll give this a go. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants