uma-pi1 / kge

LibKGE - A knowledge graph embedding library for reproducible research
MIT License
765 stars 124 forks source link

ValueError thrown by `$ kge start examples/toy-complex-train.yaml` #259

Closed tostenzel closed 2 years ago

tostenzel commented 2 years ago

value_error

When running $ kge start examples/toy-complex-train.yaml, Dataset.create() raises an error because I have no file 'kge/data/toy/dataset.yaml'; my toy folder after running $ ./download_all.sh is shown in the screenshot on the left.

Seems odd to me, is there a quick solution before I spend a lot of time debugging when trying to walk the first steps?

---Stacktrace--------------------------------------------------------------------------------------------------------------------------------------------

(venv) alfons@alfons:~/PycharmProjects/kge$ kge start examples/toy-complex-train.yaml
Loading configuration examples/toy-complex-train.yaml...
Using folder: /home/alfons/PycharmProjects/kge/local/experiments/20220128-222421-toy-complex-train
Traceback (most recent call last):
  File "/home/alfons/PycharmProjects/kge/venv/bin/kge", line 33, in <module>
    sys.exit(load_entry_point('libkge', 'console_scripts', 'kge')())
  File "/home/alfons/PycharmProjects/kge/kge/cli.py", line 262, in main
    dataset = Dataset.create(config)
  File "/home/alfons/PycharmProjects/kge/kge/dataset.py", line 107, in create
    raise ValueError(f"Dataset with name {name} could not be found.")
ValueError: Dataset with name toy could not be found.
rufex2001 commented 2 years ago

Sounds like the preprocess script that creates the dataset.yaml files and is ran by the download_all.sh script failed for the toy dataset (or all datasets). Try another dataset, and/or run the preprocess.py script manually to see the error you get.

Tobias @.***> schrieb am Fr. 28. Jan. 2022 um 22:54:

[image: value_error] https://user-images.githubusercontent.com/32765108/151626250-5c31a910-6f72-4983-a18b-2a17b04ed367.png

When running $ kge start examples/toy-complex-train.yaml --job.device cpu, Dataset.create() raises an error because I have no file 'kge/data/toy/dataset.yaml'; my toy folder after running $ download_all.sh is shown in the screenshot on the left.

Seems odd to me, is there a quick solution before I spend a lot of time debugging when trying to walk the first steps?

— Reply to this email directly, view it on GitHub https://github.com/uma-pi1/kge/issues/259, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEWXZDA7FMITDBALY4PXTTUYMF7TANCNFSM5NB3B7BQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

samuelbroscheit commented 2 years ago

(Hoping that the contents of the toy dataset are not corrupted) quick and dirty:

Create a dataset.yaml file in the toy folder with the following contents:

dataset:
  files.entity_ids.filename: entity_ids.del
  files.entity_ids.type: map
  files.relation_ids.filename: relation_ids.del
  files.relation_ids.type: map
  files.test.filename: test.del
  files.test.size: 152
  files.test.type: triples
  files.train.filename: train.del
  files.train.size: 4565
  files.train.type: triples
  files.valid.filename: valid.del
  files.valid.size: 109
  files.valid.type: triples
  name: toy
  num_entities: 280
  num_relations: 112

But it is an unusual error, please check that the other dataset folders have been created correctly, i.e. are not empty and contain a dataset.yaml file.

tostenzel commented 2 years ago

Thank you both for the quick support!

Admittedly, the reason for the problem was rather silly from my side: I did not navigate to data to run ./download_all.sh but instead did ./data/download_all.sh which messed up the path for the contained preprocess commands, e.g. python preprocess/preprocess_default.py toy :disappointed_relieved:

Now, everything is fine and the program works! Should probably not work after 11pm :sleeping: