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

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! #7

Open
SeymourNickelson opened this issue Mar 14, 2024 · 0 comments

Comments

@SeymourNickelson
Copy link

When I try to use this with an exported Torchscript model (from export_torchscript.py) I get the following error:

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!

File "code/torch/piper_train/vits/models.py", line 82, in forward
max_length = ops.prim.NumToTensor(torch.size(x4, 2))
x5 = torch.arange(annotate(number, max_length), dtype=4, layout=None, device=torch.device("cpu"), pin_memory=False)
_23 = torch.lt(torch.unsqueeze(x5, 0), torch.unsqueeze(x_lengths, 1))
~~~~~~~~ <--- HERE

Is there any instructions on how the model should be prepared in order to be used with this repository? Should the entire checkpoint be exported and loaded in? I see the source code for the vits folder is included (with lightning.py) but I don't see pytorch lightning included in the requirements.txt file so I'm wondering how a model should be prepared for use with the sample generator?

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

1 participant