A problem when running the code of DGL

When running main.py of HAN:

Traceback (most recent call last):
File “C:/Users/xiaoyu/PycharmProjects/drugbank/main.py”, line 96, in
main(args)
File “C:/Users/xiaoyu/PycharmProjects/drugbank/main.py”, line 57, in main
logits = model(g, features)
File “C:\Users\xiaoyu\Anaconda3\envs\pytorch\lib\site-packages\torch\nn\modules\module.py”, line 532, in call
result = self.forward(*input, **kwargs)
File “C:\Users\xiaoyu\PycharmProjects\drugbank\model.py”, line 75, in forward
h = gnn(g, h)
File “C:\Users\xiaoyu\Anaconda3\envs\pytorch\lib\site-packages\torch\nn\modules\module.py”, line 532, in call
result = self.forward(*input, **kwargs)
File “C:\Users\xiaoyu\PycharmProjects\drugbank\model.py”, line 58, in forward
semantic_embeddings.append(self.gat_layers[i](g, h).flatten(1))
File “C:\Users\xiaoyu\Anaconda3\envs\pytorch\lib\site-packages\torch\nn\modules\module.py”, line 532, in call
result = self.forward(*input, **kwargs)
File “C:\Users\xiaoyu\Anaconda3\envs\pytorch\lib\site-packages\dgl\nn\pytorch\conv\gatconv.py”, line 118, in forward
graph.apply_edges(fn.u_add_v(‘el’, ‘er’, ‘e’))
File “C:\Users\xiaoyu\Anaconda3\envs\pytorch\lib\site-packages\dgl\heterograph.py”, line 2704, in apply_edges
Runtime.run(prog)
File “C:\Users\xiaoyu\Anaconda3\envs\pytorch\lib\site-packages\dgl\runtime\runtime.py”, line 11, in run
exe.run()
File “C:\Users\xiaoyu\Anaconda3\envs\pytorch\lib\site-packages\dgl\runtime\ir\executor.py”, line 1078, in run
lhs_data, rhs_data, self.out_size, lhs_map, rhs_map, out_map)
File “C:\Users\xiaoyu\Anaconda3\envs\pytorch\lib\site-packages\dgl\backend\pytorch\tensor.py”, line 376, in binary_reduce
out_size, lhs_map, rhs_map, out_map)
File “C:\Users\xiaoyu\Anaconda3\envs\pytorch\lib\site-packages\dgl\backend\pytorch\tensor.py”, line 300, in forward
out_data_nd, lhs_map[0], rhs_map[0], out_map[0])
File “C:\Users\xiaoyu\Anaconda3\envs\pytorch\lib\site-packages\dgl\kernel.py”, line 148, in binary_op_reduce
A_rows, B_rows, out_rows)
File “C:\Users\xiaoyu\Anaconda3\envs\pytorch\lib\site-packages\dgl_ffi_ctypes\function.py”, line 190, in call
ctypes.byref(ret_val), ctypes.byref(ret_tcode)))
File “C:\Users\xiaoyu\Anaconda3\envs\pytorch\lib\site-packages\dgl_ffi\base.py”, line 62, in check_call
raise DGLError(py_str(_LIB.DGLGetLastError()))
dgl._ffi.base.DGLError: [17:31:12] C:\Users\Administrator\dgl\src\kernel\binary_reduce.cc:186: Check failed: ctx == arrays[i]->ctx (2:0 vs. 1:0) : Expected device context 2:0. But got 1:0 for lhs_mapping.

I have installed the nightly-built version but there‘s still some problem.Maybe there is something wrong with the configuration?

I tried HAN with nightly build on Windows Server 2016 + CUDA 10.2 and it worked for me.

Could you let me know your environment settings (such as how you installed DGL and whether you have GPU & CUDA)?

Thank you, I have solved my problem via taking the solution of #1239. I used the command pip install --pre dgl-cu92 to download the nightly version and modified softmax.py. My environment is CUDA 9.2 on Anaconda. I think my problem lies in the cmake which is an older version. So my process of installing had problems after downloading the souce.