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

Mismatch device. #4

Open
minhnn32 opened this issue Feb 26, 2024 · 1 comment
Open

Mismatch device. #4

minhnn32 opened this issue Feb 26, 2024 · 1 comment
Assignees

Comments

@minhnn32
Copy link

The error is:

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

when I run graph classification.

@minhnn32
Copy link
Author

Fix in ge-sc/sco_models/model_hetero.py
Line 212:

self.symmetrical_global_graph = self.symmetrical_global_graph.to(self.device)
for k, v in features.items():
    if v.device != self.device:
        features[k] = v.to(self.device)
self.symmetrical_global_graph.ndata['feat'] = features

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