Open BlueGhostZ opened 3 years ago
I think you can resolve this by switching to a lower version of DGL.
Hello,author. When I ran your codes, there was an error: ~/notebooks/ZY/KGAT/main_kgat.py in train(args) 113 train_nodes = train_nodes.to(device) 114 train_edges = train_edges.to(device) --> 115 train_graph.ndata['id'] = train_nodes.to(device) 116 train_graph.edata['type'] = train_edges.to(device) DGLError: Cannot assign node feature "id" on device cuda:0 to a graph on device cpu. Call DGLGraph.to() to copy the graph to the same device.
Can you help me? Thank you very much.
I switch the version of DGL to 0.4.1 and solve the issue. Wish it help you!
hello,you can move the graph to the same device with the tensor. I think this can solve you problem
Hello,author. When I ran your codes, there was an error: ~/notebooks/ZY/KGAT/main_kgat.py in train(args) 113 train_nodes = train_nodes.to(device) 114 train_edges = train_edges.to(device) --> 115 train_graph.ndata['id'] = train_nodes.to(device) 116 train_graph.edata['type'] = train_edges.to(device) DGLError: Cannot assign node feature "id" on device cuda:0 to a graph on device cpu. Call DGLGraph.to() to copy the graph to the same device.
Can you help me? Thank you very much.