Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dataset with name . could not be found. #234

Open
fratajcz opened this issue Oct 20, 2021 · 2 comments
Open

Dataset with name . could not be found. #234

fratajcz opened this issue Oct 20, 2021 · 2 comments

Comments

@fratajcz
Copy link

Hi!

I have just tried to load a checkpoint I have trained months ago and was puzzled by an error. According to the config that i get by kge dump checkpoint checkpoint_best.pt, the dataset name is "." and hence it tries to load the data from /home/user/kge/data/..

My question is, am I missing something here? It would be okay to load from /home/user/kge/data/dataset_name/, but what does the "." stand for? Is it safe to "inject" the correct dataset name by modifyng config.dataset.name?

I know I have loaded that checkpoint several times a few months ago without any problems. I have, however, switched machines and maybe not copied everything exactly.

Thanks a lot for any hint!

Traceback (most recent call last):
  File "evaluate_test.py", line 143, in <module>
    model = KgeModel.create_from(checkpoint)
  File "/home/user/kge/kge/model/kge_model.py", line 581, in create_from
    dataset = Dataset.create_from(checkpoint, config, dataset, preload_data=False)
  File "/home/user/kge/kge/dataset.py", line 147, in create_from
    dataset = Dataset.create(config, preload_data)
  File "/home/user/kge/kge/dataset.py", line 110, in create
    raise ValueError(f"Dataset with name {name} could not be found.")
ValueError: Dataset with name . could not be found.
```
@fratajcz
Copy link
Author

So I work around this now by replacing

checkpoint = load_checkpoint(path)
model = KgeModel.create_from(checkpoint)

with

checkpoint = load_checkpoint(path)
checkpoint["config"].set("dataset.name","dataset_name" )
model = KgeModel.create_from(checkpoint)

where dataset_nameis the name of the actual dataset in kge/data/

@rgemulla
Copy link
Member

Not sure what happened here; I've never seen this. You can write back the checkpoint after you updated the dataset name as in your code above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants