INK-USC / RE-Net

Recurrent Event Network: Autoregressive Structure Inference over Temporal Knowledge Graphs (EMNLP 2020)
http://inklab.usc.edu/renet/
436 stars 95 forks source link

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 1 year ago

NeuJzh commented 1 year ago

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 commented 1 year ago

image

NeuJzh commented 1 year ago

image

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

cai-yuxiang commented 1 year ago

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

lemony-sea commented 1 year ago

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 commented 1 year ago

thanks