renli1024 / SE-GNN

Semantic Evidence aware Graph Neural Network (SE-GNN) for Knowledge Graph Embedding task (AAAI'22).
59 stars 11 forks source link

实验环境 #2

Closed MiaoHu-Pro closed 2 years ago

MiaoHu-Pro commented 2 years ago

你好,

我在运行代码时,一直因为实验环境的问题报错,您能分享一下实验环境的配置吗?

Miao

renli1024 commented 2 years ago

您好,

服务器是Tesla V100 GPU (CUDA 11.1), 主要使用的包已经在README中标明了 (PyTorch, DGL和Hydra), 建议可以结合具体错误排查下.

谢谢

MiaoHu-Pro commented 2 years ago

您好,

服务器是Tesla V100 GPU (CUDA 11.1), 主要使用的包已经在README中标明了 (PyTorch, DGL和Hydra), 建议可以结合具体错误排查下.

谢谢

请问python版本是多少?3.6吗?

renli1024 commented 2 years ago

python版本是3.9, 不过我感觉不太会是包版本的问题, 你可以把报错信息贴上来看下.

MiaoHu-Pro commented 2 years ago

python版本是3.9, 不过我感觉不太会是包版本的问题, 你可以把报错信息贴上来看下.

please see the log as follows:

34 /users/40305887/python_project/se_gnn_env/lib/python3.8/site-packages/hydra/_internal/hydra.py:119: UserWarning: Future Hydra versions will no longer change working directory at job runtime by default. 35 See https://hydra.cc/docs/next/upgrades/1.1_to_1.2/changes_to_job_working_dir/ for more information. 36 ret = run_job( 37 Error executing job with overrides: ['dataset=WN18RR'] 38 An error occurred during Hydra's exception formatting: 39 AssertionError() 40 Traceback (most recent call last): 41 File "/users/40305887/python_project/se_gnn_env/lib/python3.8/site-packages/hydra/_internal/utils.py", line 254, in run_and_report 42 assert mdl is not None 43 AssertionError 44 45 During handling of the above exception, another exception occurred: 46 47 Traceback (most recent call last): 48 File "/users/40305887/python_project/SE-GNN/code/run.py", line 219, in 49 main() 50 File "/users/40305887/python_project/se_gnn_env/lib/python3.8/site-packages/hydra/main.py", line 90, in decorated_main 51 _run_hydra( 52 File "/users/40305887/python_project/se_gnn_env/lib/python3.8/site-packages/hydra/_internal/utils.py", line 389, in _run_hydra 53 _run_app( 54 File "/users/40305887/python_project/se_gnn_env/lib/python3.8/site-packages/hydra/_internal/utils.py", line 452, in _run_app 55 run_and_report( 56 File "/users/40305887/python_project/se_gnn_env/lib/python3.8/site-packages/hydra/_internal/utils.py", line 296, in run_and_report 57 raise ex 58 File "/users/40305887/python_project/se_gnn_env/lib/python3.8/site-packages/hydra/_internal/utils.py", line 213, in run_and_report 59 return func() 60 File "/users/40305887/python_project/se_gnn_env/lib/python3.8/site-packages/hydra/_internal/utils.py", line 453, in 61 lambda: hydra.run( 62 File "/users/40305887/python_project/se_gnn_env/lib/python3.8/site-packages/hydra/internal/hydra.py", line 132, in run 63 = ret.return_value 64 File "/users/40305887/python_project/se_gnn_env/lib/python3.8/site-packages/hydra/core/utils.py", line 260, in return_value 65 raise self._return_value 66 File "/users/40305887/python_project/se_gnn_env/lib/python3.8/site-packages/hydra/core/utils.py", line 186, in run_job 67 ret.return_value = task_function(task_cfg) 68 File "/users/40305887/python_project/SE-GNN/code/run.py", line 108, in main 69 kg = get_kg(src, dst, rel, device) 70 File "/users/40305887/python_project/SE-GNN/code/data_helper.py", line 159, in get_kg 71 kg = kg.to(device) 72 File "/users/40305887/python_project/se_gnn_env/lib/python3.8/site-packages/dgl/heterograph.py", line 5448, in to 73 ret._graph = self._graph.copy_to(utils.to_dgl_context(device)) 74 File "/users/40305887/python_project/se_gnn_env/lib/python3.8/site-packages/dgl/heterograph_index.py", line 236, in copy_to 75 return _CAPI_DGLHeteroCopyTo(self, ctx.device_type, ctx.device_id) 76 File "dgl/_ffi/_cython/./function.pxi", line 293, in dgl._ffi._cy3.core.FunctionBase.call 77 File "dgl/_ffi/_cython/./function.pxi", line 225, in dgl._ffi._cy3.core.FuncCall 78 File "dgl/_ffi/_cython/./function.pxi", line 215, in dgl._ffi._cy3.core.FuncCall3 79 dgl._ffi.base.DGLError: [19:54:43] /opt/dgl/src/runtime/c_runtime_api.cc:88: Check failed: allow_missing: Device API gpu is not enabled. Please install the cuda version of dgl. 80 Stack trace: 81 [bt] (0) /users/40305887/python_project/se_gnn_env/lib/python3.8/site-packages/dgl/libdgl.so(dmlc::LogMessageFatal::~LogMessageFatal()+0x4f) [0x7f9a500da29f] 82 [bt] (1) /users/40305887/python_project/se_gnn_env/lib/python3.8/site-packages/dgl/libdgl.so(dgl::runtime::DeviceAPIManager::GetAPI(std::string, bool)+0x37c) [0x7f9a503ac72c] 83 [bt] (2) /users/40305887/python_project/se_gnn_env/lib/python3.8/site-packages/dgl/libdgl.so(dgl::runtime::DeviceAPI::Get(DLContext, bool)+0x1f4) [0x7f9a503a6b14] 84 [bt] (3) /users/40305887/python_project/se_gnn_env/lib/python3.8/site-packages/dgl/libdgl.so(dgl::runtime::NDArray::CopyFromTo(DLTensor, DLTensor, void)+0x242) [0x7f9a503c7c72] 85 [bt] (4) /users/40305887/python_project/se_gnn_env/lib/python3.8/site-packages/dgl/libdgl.so(dgl::runtime::NDArray::CopyTo(DLContext const&, void const&) const+0xfb) [0x7f9a5040422b] 86 [bt] (5) /users/40305887/python_project/se_gnn_env/lib/python3.8/site-packages/dgl/libdgl.so(dgl::UnitGraph::CopyTo(std::shared_ptr, DLContext const&, void const&)+0x317) [0x7f9a50514fa7] 87 [bt] (6) /users/40305887/python_project/se_gnn_env/lib/python3.8/site-packages/dgl/libdgl.so(dgl::HeteroGraph::CopyTo(std::shared_ptr, DLContext const&, void const&)+0x109) [0x7f9a50416069] 88 [bt] (7) /users/40305887/python_project/se_gnn_env/lib/python3.8/site-packages/dgl/libdgl.so(+0x4eb739) [0x7f9a50423739] 89 [bt] (8) /users/40305887/python_project/se_gnn_env/lib/python3.8/site-packages/dgl/libdgl.so(DGLFuncCall+0x48) [0x7f9a503a60e8]

@renli1024

MiaoHu-Pro commented 2 years ago

您能提供一下 requirement文件吗?

renli1024 commented 2 years ago

Check failed: allow_missing: Device API gpu is not enabled. Please install the cuda version of dgl.

应该是dgl和cuda版本不匹配的问题, 建议检查一下, 可以参考官方手册: https://www.dgl.ai/pages/start.html .

MiaoHu-Pro commented 2 years ago

Check failed: allow_missing: Device API gpu is not enabled. Please install the cuda version of dgl.

应该是dgl和cuda版本不匹配的问题, 建议检查一下, 可以参考官方手册: https://www.dgl.ai/pages/start.html .

我的服务器CUDA 是11.0 当我安装了 torch 1.7.1+cu110; dgl-cu110 0.9.1; 依然报错,错误如下:

22 Traceback (most recent call last): 23 File "/users/40305887/python_project/SE-GNN/code/run.py", line 16, in 24 from model import SE_GNN 25 File "/users/40305887/python_project/SE-GNN/code/model.py", line 5, in 26 import dgl.function as fn 27 ModuleNotFoundError: No module named 'dgl.function'

renli1024 commented 2 years ago

这应该是dgl安装的问题, 你可以试试其他的dgl代码是否可以运行, 不行的话尝试重装下dgl吧.

另外附下我的包版本:

python: 3.9.7
cuda: 11.1 (linux-64/cudatoolkit-11.1.74-h6bb024c_0.tar.bz2)
pytorch: 1.9.1 (py3.9_cuda11.1_cudnn8.0.5_0)
dgl: 0.7.2 (dgl-cuda11.1-0.7.2-py39_0)
hydra: 1.1.1

在这个环境下代码是可以运行的.