Closed ccvalley closed 3 years ago
You run it as ?
!DGLBACKEND=pytorch dglke_predict \
--model_path /ckpts/TransE_l2_KGE_test_0/ \
--format 'h_*_t' \
--data_files /data/head.list \
/data/tail.list \
--exec_mode batch_head \
--score_func logsigmoid \
--topK 5 \
--output predict.tsv
I've tried running it both with and without the relation.list input and receive the same error.
Both of these runs give the same error listed above:
!DGLBACKEND=pytorch dglke_predict \
--model_path /ckpts/TransE_l2_KGE_test_0/ \
--format 'h_r_t' \
--data_files /data/head.list /data/rel.list /data/tail.list \
--exec_mode batch_head \
--score_func logsigmoid \
--topK 5 \
--output predict.tsv
!DGLBACKEND=pytorch dglke_predict \
--model_path /ckpts/TransE_l2_KGE_test_0/ \
--format 'h_*_t' \
--data_files /data/head.list /data/tail.list \
--exec_mode batch_head \
--score_func logsigmoid \
--topK 5 \
--output predict.tsv
If it helps, here are the versions for DGL, DGLKE, and numpy (which seems to be throwing the error at line 173 in the topK function):
dgl: '0.4.3post2' (we've also tried with 0.4.3 and 0.5 and receive the same error) dglke: '0.1.2' numpy: '1.18.1'
Please let me know if you need any additional information. Thanks!
Which pytorch version you are using?
Can you try install dglke from source? This commit https://github.com/awslabs/dgl-ke/commit/e770b4ee96e51a3919bc4196791192dc625ab06b fixed a bug related to th.floor_divide. I am not sure whether it is included in kge-0.1.2
Hi @classicsong - thanks for the help. Installing from source ('0.1.0.dev') seems to have fixed the issue we're seeing when installing the latest version (0.1.2).
The issue in v0.1.2 seems to be in this line within topK function in infer.py:
idx = idx / num_tail
Which was corrected to use the th.floor_divide in v0.1.0.dev:
idx = floor_divide(idx, num_tail)
Is it possible to push these changes to kge-0.1.2 or a never version which we can install using PyPI/pip?
Thanks!
Currently, you can only install from source. We will release 0.1.3 later to include this bug fix.
I noticed someone else mentioned this in another issue (https://github.com/awslabs/dgl-ke/issues/178), but I haven't seen it resolved.
I'm running dglke_predict on trained embeddings and having issues making predictions on h_r_t format, specifically with the relations list file. The h and t files work in dglke_emb_sim as L and R input files.
This also gives the same error if I run dglkepredict using `--format 'h*_t'` and eliminate the rel.list input file.
Is giving this error:
Thank you.