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

When I ran pre-train, pc said that the data of the graph was not placed in the gpu. Is it related to the dgl version? Or is there a problem with the code you wrote #69

Open
NeuJzh opened this issue Feb 6, 2023 · 5 comments

Comments

@NeuJzh
Copy link

NeuJzh commented Feb 6, 2023

dgl._ffi.base.DGLError: Cannot assign node feature "h" on device cuda:0 to a graph on device cpu. Call DGLGraph.to() to copy the graph to the same device.

@NeuJzh
Copy link
Author

NeuJzh commented Feb 6, 2023

image

@NeuJzh
Copy link
Author

NeuJzh commented Feb 6, 2023

image

I use debug code,this place might have some errors。

@cai-yuxiang
Copy link

yes , i also meet the problem. Do you deal with it?

@lemony-sea
Copy link

copy the graph to the device : cuda0
use the following code :
for key in graph_dict:
graph_dict[key] = graph_dict[key].to(torch.device("cuda" if use_cuda else "cpu"))

@suojifeng
Copy link

thanks

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

4 participants