Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The notebook for Link Prediction for custom KG won't work #247

Open
riaz opened this issue Dec 22, 2021 · 1 comment
Open

The notebook for Link Prediction for custom KG won't work #247

riaz opened this issue Dec 22, 2021 · 1 comment

Comments

@riaz
Copy link

riaz commented Dec 22, 2021

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

@gsanou
Copy link

gsanou commented Mar 23, 2022

Hello you may downgrade your dgl version to 0.4.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants