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

AttributeError: 'bytearray' object has no attribute 'contiguous' #45

Closed ZM7 closed 2 years ago

ZM7 commented 3 years ago

When I run the pretrain.py on GDELT, the following errors occur: File "/data3/zhangmengqi/RE-Net/pretrain.py", line 139, in train(args) File "/data3/zhangmengqi/RE-Net/pretrain.py", line 55, in train graph_dict = pickle.load(f) File "/home/zhangmengqi/anaconda3/envs/renet/lib/python3.6/site-packages/dgl/heterograph_index.py", line 1122, in setstate num_nodes_per_type = F.zerocopy_to_dgl_ndarray(num_nodes_per_type) File "/home/zhangmengqi/anaconda3/envs/renet/lib/python3.6/site-packages/dgl/backend/pytorch/tensor.py", line 283, in zerocopy_to_dgl_ndarray return nd.from_dlpack(dlpack.to_dlpack(input.contiguous())) AttributeError: 'bytearray' object has no attribute 'contiguous'

Do you know the reason? I guess the problem with the DGL version, could you tell me the specific version of your numpy and DGL? Thanks!

PengpengShao commented 3 years ago

I have the same problem with you, how did you fix it?

1qingqing1 commented 3 years ago

I have the same problem with you, how did you fix it? I meet the problem too, did you fix it?

1qingqing1 commented 3 years ago

When I run the pretrain.py on GDELT, the following errors occur: File "/data3/zhangmengqi/RE-Net/pretrain.py", line 139, in train(args) File "/data3/zhangmengqi/RE-Net/pretrain.py", line 55, in train graph_dict = pickle.load(f) File "/home/zhangmengqi/anaconda3/envs/renet/lib/python3.6/site-packages/dgl/heterograph_index.py", line 1122, in setstate num_nodes_per_type = F.zerocopy_to_dgl_ndarray(num_nodes_per_type) File "/home/zhangmengqi/anaconda3/envs/renet/lib/python3.6/site-packages/dgl/backend/pytorch/tensor.py", line 283, in zerocopy_to_dgl_ndarray return nd.from_dlpack(dlpack.to_dlpack(input.contiguous())) AttributeError: 'bytearray' object has no attribute 'contiguous'

Do you know the reason? I guess the problem with the DGL version, could you tell me the specific version of your numpy and DGL? Thanks!

I meet the problem too, did you fix it?

woojeongjin commented 2 years ago

Hi, this is possibly a version issue. I used 0.4.3post2 version of DGL.