migalkin / NodePiece

Compositional and Parameter-Efficient Representations for Large Knowledge Graphs (ICLR'22)
MIT License
139 stars 20 forks source link

TypeError: evaluate() got an unexpected keyword argument 'additional_filter_triples' #6

Closed nomisto closed 11 months ago

nomisto commented 11 months ago

Hello I get a type error when running the code for the standard link prediction:

python run_lp.py -loop lcwa -loss bce -b 512 -data fb15k237 -anchors 1000 -sp 100 -lr 0.0005 -ft_maxp 20 -pool cat -embedding 200 -sample_rels 15 -smoothing 0.4 -epochs 401

and installing dependencies using the requirements.txt specified in your repo:

torch==1.7.1
pykeen==1.0.5
click
torch-geometric==1.6.3
torch_sparse==0.6.8
torch-scatter==2.0.5
torch-cluster==1.5.8
torch-spline-conv==1.2.0
pystow==0.1.0
einops
python-igraph
tqdm
wandb

Error:

Traceback (most recent call last):
  File "run_lp.py", line 260, in <module>
    main()
   ...
  File "run_lp.py", line 239, in main
    metric_results = test_evaluator.evaluate(
TypeError: evaluate() got an unexpected keyword argument 'additional_filter_triples'

The reason for that is that the pykeen evaluate keyword additional_filter_triples did not exist in version 1.0.5. What pykeen version should I use?

(I am aware that NodePiece is already integrated in Pykeen, however I want to rerun some expirements from your paper)

nomisto commented 11 months ago

And I cannot upgrade pykeen, because then I get

Traceback (most recent call last):
  File "run_lp.py", line 17, in <module>
    from pykeen105.relation_rank_evaluator import RelationPredictionRankBasedEvaluator
  File "/var/data/storage/home/otts/rules/notebooks/rulepiece/NodePiece/lp_rp/pykeen105/relation_rank_evaluator.py", line 4, in <module>
    from pykeen.evaluation.rank_based_evaluator import pd, RankBasedMetricResults, dataclass, field, dataclass_json, fix_dataclass_init_docs, compute_rank_from_scores, RANK_TYPES, RANK_BEST, RANK_WORST, RANK_AVERAGE, RANK_AVERAGE_ADJUSTED
ImportError: cannot import name 'dataclass' from 'pykeen.evaluation.rank_based_evaluator' (/home/otts/storage/envs/nodepiece_v7/lib/python3.8/site-packages/pykeen/evaluation/rank_based_evaluator.py)
nomisto commented 11 months ago

Ahh somehow I didn't read: https://github.com/migalkin/NodePiece#test-evaluation-reproducibility-patch This fixes it.