awslabs / dgl-ke

High performance, easy-to-use, and scalable package for learning large-scale knowledge graph embeddings.
https://dglke.dgl.ai/doc/
Apache License 2.0
1.25k stars 194 forks source link

will dgl.heterograph be supported #246

Open SsrCode opened 2 years ago

SsrCode commented 2 years ago

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

riaz commented 2 years ago

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::Check(sptr.get()): Expected type graph.Graph but get graph.HeteroGraph

zahramahani commented 2 years ago

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 commented 2 years ago

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

ChrisDelClea commented 1 year ago

+1, same error here.