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

Solution for CUDA error #5

Open
Lucienxhh opened this issue Jul 19, 2022 · 2 comments
Open

Solution for CUDA error #5

Lucienxhh opened this issue Jul 19, 2022 · 2 comments

Comments

@Lucienxhh
Copy link

If you want to train model on CUDA, modify these lines as follows:

{
    "Modification1":
    {
        "file": "models.py",
        "lines": [193],
        "origin": "if not isinstance(adj, torch.sparse.FloatTensor): ",
        "new": "if adj.layout != torch.sparse_coo:"
    },
    "Modification2":
    {
        "file": "utils.py",
        "lines": [275, 294, 349],
        "origin": "distance = squareform(pdist(chosen_embed.detach()))",
        "new": "distance = squareform(pdist(chosen_embed.cpu().detach()))"
    },
}

Though there are still some lines reporting errors, modify them referring to Modification2 (i.e., xx.detach() => xx.cpu().detach())

@TianxiangZhao Please check it if convenient. if correct, a modification sounds good.

@TianxiangZhao
Copy link
Owner

Thanks!@Lucienxhh

@godlovxiari
Copy link

When I modified according to the suggestions, I encountered new problems:
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0
How to solve this problem? thank you.

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

3 participants