Skip to content
New issue

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

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

Already on GitHub? # to your account

Input type and weight type should be the same #88

Closed
Ca-ressemble-a-du-fake opened this issue Mar 7, 2023 · 2 comments
Closed

Input type and weight type should be the same #88

Ca-ressemble-a-du-fake opened this issue Mar 7, 2023 · 2 comments

Comments

@Ca-ressemble-a-du-fake
Copy link
Contributor

Hi,

While running inference I keep getting IMS-Toucan/TrainingInterfaces/Text_to_Spectrogram/PortaSpeech/Glow.py", line 123, in forward z = F.conv2d(x, weight) RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same

It is solved by running on CPU but it can also be solved more elegantly by bringing the model weight to the same device than the data (adding .to(x.device) on line 123 in forward method of Glow.py) :
weight = weight.view(self.n_split, self.n_split, 1, 1).to(x.device)

Should I write a pull request or you want to correct it in a different way ?

@Flux9665
Copy link
Collaborator

Flux9665 commented Mar 8, 2023

good catch, thanks for letting me know. Feel free to make a PR, otherwise I'll fix it some time in the next few days.

@Ca-ressemble-a-du-fake
Copy link
Contributor Author

Ok gonna do it.

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

No branches or pull requests

2 participants