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

Which version of dgl-cu100 do you use? #36

Closed gal0is closed 3 years ago

gal0is commented 4 years ago

pip install dgl-cu100 will install version 0.5.2

There will be some runtime errors on this version, like:

AttributeError: 'DGLHeteroGraph' object has no attribute 'parent_nid'

Yongquan-He commented 3 years ago

I also meet this problem. If you have solved it, please tell me. Thanks!

xyjigsaw commented 3 years ago

From 0.5, subgraphs extracted via DGL APIs automatically inherit node and edge features from the parent graph. DGL also saves the original nodes/edge IDs in subg.ndata[dgl.NID] and subg.edata[dgl.EID] if nodes/edges are relabeled. This new behavior makes the following DGLGraph methods useless and they have been removed:

  1. DGLGraph.parent , DGLGraph.parent_nid , DGLGraph.parent_eid ,
  2. DGLGraph.map_to_subgraph_nid , DGLGraph.copy_from_parent ,
  3. DGLGraph.copy_to_parent and DGLGraph.detach_parent .

However, when I rerun this project, there still many errors coming up. I hope the authors will provide requirements.txt.

woojeongjin commented 3 years ago

Hello, sorry for the late comment.

Could you run the following commands?

conda create -n renet python=3.6 numpy
conda activate renet
pip install torch==1.6.0+cu101 torchvision==0.7.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html
conda install -c dglteam "dgl-cuda10.1<0.5"

If you have other problems, please let me know!

turoger commented 3 years ago

Hi Woojeongjin,

Can you advise what to do with the environment? I have tried setting up the conda environment with the commands provided. I ended up with this error when running python3 get_history_graph.py in my cd data/dataset:

OSError: libcublas.so.10: cannot open shared object file: No such file or directory

The Traceback takes me to:

Traceback (most recent call last):
  File "get_history_graph.py", line 5, in <module>
    import dgl
  File "/home/rogertu/anaconda3/envs/renet/lib/python3.6/site-packages/dgl/__init__.py", line 8, in <module>
    from .backend import load_backend, backend_name
  File "/home/rogertu/anaconda3/envs/renet/lib/python3.6/site-packages/dgl/backend/__init__.py", line 74, in <module>
    load_backend(get_preferred_backend())
  File "/home/rogertu/anaconda3/envs/renet/lib/python3.6/site-packages/dgl/backend/__init__.py", line 24, in load_backend
    mod = importlib.import_module('.%s' % mod_name, __name__)
  File "/home/rogertu/anaconda3/envs/renet/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/home/rogertu/anaconda3/envs/renet/lib/python3.6/site-packages/dgl/backend/pytorch/__init__.py", line 1, in <module>
    from .tensor import *
  File "/home/rogertu/anaconda3/envs/renet/lib/python3.6/site-packages/dgl/backend/pytorch/tensor.py", line 10, in <module>
    from ... import ndarray as nd
  File "/home/rogertu/anaconda3/envs/renet/lib/python3.6/site-packages/dgl/ndarray.py", line 14, in <module>
    from ._ffi.object import register_object, ObjectBase
  File "/home/rogertu/anaconda3/envs/renet/lib/python3.6/site-packages/dgl/_ffi/object.py", line 8, in <module>
    from .object_generic import ObjectGeneric, convert_to_object
  File "/home/rogertu/anaconda3/envs/renet/lib/python3.6/site-packages/dgl/_ffi/object_generic.py", line 7, in <module>
    from .base import string_types
  File "/home/rogertu/anaconda3/envs/renet/lib/python3.6/site-packages/dgl/_ffi/base.py", line 42, in <module>
    _LIB, _LIB_NAME = _load_lib()
  File "/home/rogertu/anaconda3/envs/renet/lib/python3.6/site-packages/dgl/_ffi/base.py", line 34, in _load_lib
    lib = ctypes.CDLL(lib_path[0], ctypes.RTLD_GLOBAL)
  File "/home/rogertu/anaconda3/envs/renet/lib/python3.6/ctypes/__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libcublas.so.10: cannot open shared object file: No such file or directory

My installed packages in my environment look as recommended:

#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main  
blas                      1.0                         mkl  
ca-certificates           2020.12.8            h06a4308_0  
certifi                   2020.12.5        py36h06a4308_0  
decorator                 4.4.2                      py_0  
dgl-cuda10.1              0.4.3post2               py36_0    dglteam
future                    0.18.2                   pypi_0    pypi
intel-openmp              2020.2                      254  
ld_impl_linux-64          2.33.1               h53a641e_7  
libedit                   3.1.20191231         h14c3975_1  
libffi                    3.3                  he6710b0_2  
libgcc-ng                 9.1.0                hdf63c60_0  
libgfortran-ng            7.3.0                hdf63c60_0  
libstdcxx-ng              9.1.0                hdf63c60_0  
mkl                       2020.2                      256  
mkl-service               2.3.0            py36he8ac12f_0  
mkl_fft                   1.2.0            py36h23d657b_0  
mkl_random                1.1.1            py36h0573a6f_0  
ncurses                   6.2                  he6710b0_1  
networkx                  2.5                        py_0  
numpy                     1.19.2           py36h54aff64_0  
numpy-base                1.19.2           py36hfa32c7d_0  
openssl                   1.1.1i               h27cfd23_0  
pillow                    8.1.0                    pypi_0    pypi
pip                       20.3.3           py36h06a4308_0  
python                    3.6.12               hcff3b4d_2  
readline                  8.0                  h7b6447c_0  
scipy                     1.5.2            py36h0b6359f_0  
setuptools                51.0.0           py36h06a4308_2  
six                       1.15.0           py36h06a4308_0  
sqlite                    3.33.0               h62c20be_0  
tk                        8.6.10               hbc83047_0  
torch                     1.6.0+cu101              pypi_0    pypi
torchvision               0.7.0+cu101              pypi_0    pypi
wheel                     0.36.2             pyhd3eb1b0_0  
xz                        5.2.5                h7b6447c_0  
zlib                      1.2.11               h7b6447c_3  
woojeongjin commented 3 years ago

Hi, What is your cuda version? You should install pytorch with your cuda version. The example command is for CUDA 10.1.

Thanks!

turoger commented 3 years ago

Hi woojeongjin,

You are correct. Installed cuda and it appears to be running. New machine, didn't realize cuda wasn't installed. I checked cuda by calling nvcc --version. Since it wasn't installed I had the administrator install it with sudo apt install nvidia-cuda-toolkit. Thanks for the help!