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

ObjectTypeChecker<TObjectRef>::Check(sptr.get()): Expected type graph.Graph but get graph.HeteroGraph ? #231

Closed JH-lee95 closed 2 years ago

JH-lee95 commented 2 years ago

Using backend: pytorch Reading train triples.... Finished. Read 483142 train triples. Reading valid triples.... Finished. Read 50000 valid triples. Reading test triples.... Finished. Read 59071 test triples. |Train|: 483142 random partition 483142 edges into 8 parts part 0 has 60393 edges part 1 has 60393 edges part 2 has 60393 edges part 3 has 60393 edges part 4 has 60393 edges part 5 has 60393 edges part 6 has 60393 edges part 7 has 60391 edges /usr/local/lib/python3.7/dist-packages/dgl/base.py:45: DGLWarning: Recommend creating graphs by dgl.graph(data) instead of dgl.DGLGraph(data). return warnings.warn(message, category=category, stacklevel=1) /usr/local/lib/python3.7/dist-packages/dgl/base.py:45: DGLWarning: Keyword arguments ['readonly', 'multigraph', 'sort_csr'] are deprecated in v0.5, and can be safely removed in all cases. return warnings.warn(message, category=category, stacklevel=1) Traceback (most recent call last): File "/usr/local/bin/dglke_train", line 8, in sys.exit(main()) File "/usr/local/lib/python3.7/dist-packages/dglke/train.py", line 125, in main rank=i) File "/usr/local/lib/python3.7/dist-packages/dglke/dataloader/sampler.py", line 388, in create_sampler return_false_neg=False) File "/usr/local/lib/python3.7/dist-packages/dgl/contrib/sampling/sampler.py", line 695, in init self._chunk_size) 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: [06:51:35] /opt/dgl/include/dgl/packed_func_ext.h:117: Check failed: ObjectTypeChecker::Check(sptr.get()): Expected type graph.Graph but get graph.HeteroGraph Stack trace: [bt] (0) /usr/local/lib/python3.7/dist-packages/dgl/libdgl.so(dmlc::LogMessageFatal::~LogMessageFatal()+0x22) [0x7f4005361212] [bt] (1) /usr/local/lib/python3.7/dist-packages/dgl/libdgl.so(dgl::GraphRef dgl::runtime::DGLArgValue::AsObjectRef() const+0x38c) [0x7f40054ae3ac] [bt] (2) /usr/local/lib/python3.7/dist-packages/dgl/libdgl.so(+0x9a99de) [0x7f4005b149de] [bt] (3) /usr/local/lib/python3.7/dist-packages/dgl/libdgl.so(DGLFuncCall+0x52) [0x7f4005a5bad2] [bt] (4) /usr/local/lib/python3.7/dist-packages/dgl/_ffi/_cy3/core.cpython-37m-x86_64-linux-gnu.so(+0x19b2b) [0x7f4004f60b2b] [bt] (5) /usr/local/lib/python3.7/dist-packages/dgl/_ffi/_cy3/core.cpython-37m-x86_64-linux-gnu.so(+0x1a1db) [0x7f4004f611db] [bt] (6) /usr/bin/python3(_PyObject_FastCallKeywords+0x92) [0x561bd5a0a7b2] [bt] (7) /usr/bin/python3(_PyEval_EvalFrameDefault+0x4795) [0x561bd5a7de65] [bt] (8) /usr/bin/python3(_PyEval_EvalCodeWithName+0x2f5) [0x561bd5a78c35]

I tried to train the model on my custom dataset, but I got this error.

I tried to fix it by changing version of dglke (0.1.2 -> 0.1.0) and it wasn't helpful at all.

How can I fix this issue?

classicsong commented 2 years ago

You should use DGL 0.4.3post2

JH-lee95 commented 2 years ago

You should use DGL 0.4.3post2

Thanks! I resolved this issue!

Su-hong-yu commented 2 years ago

You should use DGL 0.4.3post2

can you tell me how to use it? thank you.

JH-lee95 commented 2 years ago

You should use DGL 0.4.3post2

can you tell me how to use it? thank you.

You can just downgrade the version to 0.4.3

Su-hong-yu commented 2 years ago

thank you

---Original--- From: "이정환 (Lee @.> Date: Mon, Nov 29, 2021 09:57 AM To: @.>; Cc: @.**@.>; Subject: Re: [awslabs/dgl-ke]ObjectTypeChecker<TObjectRef>::Check(sptr.get()): Expected type graph.Graphbut get graph.HeteroGraph ? (#231)

You should use DGL 0.4.3post2

can you tell me how to use it? thank you.

You can just downgrade the version to 0.4.3

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

chen0867 commented 2 years ago

I ran into this same issue, but DGL 0.4.3.post2 is not available to install anymore? pip3 install dgl==0.4.3.post2 returns error:

ERROR: Could not find a version that satisfies the requirement dgl==0.4.3.post2 (from versions: 0.1.0, 0.1.2, 0.1.3, 0.8.0.post1) ERROR: No matching distribution found for dgl==0.4.3.post2

please help!

classicsong commented 2 years ago

0.4.3post2

chen0867 commented 2 years ago

Thanks for your reply. My python need to be downgraded to version 3.8, then 'pip install dgl==' will show 0.4.3.post2 available as shown here: ( 0.1.0, 0.1.2, 0.1.3, 0.4.3, 0.4.3.post1, 0.4.3.post2, 0.5.0, 0.5.1, 0.5.2, 0.5.3, 0.6.0, 0.6.0.post1, 0.6.1).