dgl-ke icon indicating copy to clipboard operation
dgl-ke copied to clipboard

will dgl.heterograph be supported

Open SsrCode opened this issue 3 years ago • 4 comments

Thanks for your team's good work. But it's a pity that dgl-ke does not support dgl.heterograph. Do your team has a plan to support dgl 0.7? It will help us a lot. Thank you

SsrCode avatar Dec 16 '21 07:12 SsrCode

I was trying the example "Knowledge Graph Embedding using the Wikimedia knowledge graph." and given that WikiMedia is a heterogeneous graph, the current notebook wont work since the EdgeSampler is assuming the edges of a homogeneous graph.

Here is the error that i get when i run this:

%%time !DGLBACKEND=pytorch dglke_eval --dataset wikimedia --model_name TransE_l2
--neg_sample_size 200 --hidden_dim 400 --gamma 19.9
--batch_size_eval 16 --gpu 0 1 2 3 --model_path ./wikimedia/TransE_l2_wikimedia_0/
--data_path ~/Documents/WikiMedia/ --format raw_udd_hrt --data_files train.txt valid.txt test.txt --neg_sample_size_eval 10000 --no_eval_filter

Error:

Traceback (most recent call last): File "/Users/rmunshi/opt/miniconda3/envs/omni/bin/dglke_eval", line 8, in sys.exit(main()) File "/Users/rmunshi/opt/miniconda3/envs/omni/lib/python3.8/site-packages/dglke/eval.py", line 149, in main test_sampler_head = eval_dataset.create_sampler('test', args.batch_size_eval, File "/Users/rmunshi/opt/miniconda3/envs/omni/lib/python3.8/site-packages/dglke/dataloader/sampler.py", line 678, in create_sampler return EvalSampler(self.g, edges, batch_size, neg_sample_size, neg_chunk_size, File "/Users/rmunshi/opt/miniconda3/envs/omni/lib/python3.8/site-packages/dglke/dataloader/sampler.py", line 510, in init self.sampler = EdgeSampler(g, File "/Users/rmunshi/opt/miniconda3/envs/omni/lib/python3.8/site-packages/dgl/contrib/sampling/sampler.py", line 683, in init self._sampler = _CAPI_CreateUniformEdgeSampler( File "dgl/_ffi/_cython/./function.pxi", line 287, in dgl._ffi._cy3.core.FunctionBase.call File "dgl/_ffi/_cython/./function.pxi", line 232, in dgl._ffi._cy3.core.FuncCall File "dgl/_ffi/_cython/./base.pxi", line 155, in dgl._ffi._cy3.core.CALL dgl._ffi.base.DGLError: [10:31:09] /tmp/dgl_src/include/dgl/packed_func_ext.h:117: Check failed: ObjectTypeChecker<TObjectRef>::Check(sptr.get()): Expected type graph.Graph but get graph.HeteroGraph

riaz avatar Dec 22 '21 23:12 riaz

Thanks for your team's good work. But it's a pity that dgl-ke does not support dgl.heterograph. Do your team has a plan to support dgl 0.7? It will help us a lot. Thank you

zahramahani avatar Dec 30 '21 09:12 zahramahani

Thanks for your team's good work. But it's a pity that dgl-ke does not support dgl.heterograph. Do your team has a plan to support dgl 0.7? It will help us a lot. Thank you

zahramahani avatar Dec 30 '21 09:12 zahramahani

+1, same error here.

ChrisDelClea avatar Aug 03 '22 14:08 ChrisDelClea