Glaciohound / LERP

Official Repository for ICLR 2023 Paper: Logical Entity Representation in Knowledge-Graphs for Differentiable Rule Learning
MIT License
11 stars 5 forks source link

执行命令“ bash scripts/run_wn18rr.sh /log 0”,后报错:Traceback (most recent call last): File "/root/LERP-main/graph_completion/src/eval/evaluate.py", line 89, in <module> evaluate() File "/root/LERP-main/graph_completion/src/eval/evaluate.py", line 33, in evaluate lines = [l.strip().split(",") for l in open(option.preds).readlines()] FileNotFoundError: [Errno 2] No such file or directory: './log/WN18RR/test_predictions.txt' #4

Open star-rui opened 10 months ago

star-rui commented 10 months ago

经在lerp同级目录中新建了log文件夹。 请问这个报错如何解决呢?是缺少文件吗

star-rui commented 10 months ago

报错如下:Namespace(preds='./log/WN18RR/test_predictions.txt', truths='graph_completion/datasets/WN18RR/truths.pckl', top_k=[1, 3, 10], raw=False, v=False, hits_by_q=False) Traceback (most recent call last): File "/root/LERP-main/graph_completion/src/eval/evaluate.py", line 89, in evaluate() File "/root/LERP-main/graph_completion/src/eval/evaluate.py", line 33, in evaluate lines = [l.strip().split(",") for l in open(option.preds).readlines()] FileNotFoundError: [Errno 2] No such file or directory: './log/WN18RR/test_predictions.txt'

Glaciohound commented 9 months ago

你好!感谢你对我们工作的兴趣。 这个问题的直接原因是模型最后的生成结果没有写在目标位置:$LOG/$TRIAL/test_predictions.txt 里,你可以检查一下是否是 scripts/run_wn18rr.sh 里的训练命令 main.py 没有执行完成。 生成结果的函数在这里: https://github.com/Glaciohound/LERP/blob/main/graph_completion/src/train/experiment.py#L178 以及在这里被调用: https://github.com/Glaciohound/LERP/blob/main/graph_completion/src/train/main.py#L193