haseebs / OWE

Pytorch code for An Open-World Extension to Knowledge Graph Completion Models (AAAI 2019)
https://aaai.org/ojs/index.php/AAAI/article/view/4162
37 stars 9 forks source link

AttributeError: 'NoneType' object has no attribute 'endswith' #21

Open Balabala0792 opened 2 years ago

Balabala0792 commented 2 years ago

This problem occurs when I run 'run_open_world.py'. And the first thing that went wrong was the following line of code in the 'data.py' file. "return KeyedVectors.load_word2vec_format(embedding_file, binary=not embedding_file.endswith(".txt")) " I woule like to know what this line of code means and what the endswith function means. Thank you!

haseebs commented 2 years ago

This is just to detect whether the embedding file you downloaded is binary or .txt. I would recommend using a binary file since it loads faster.

But if it doesn't work, you can use the .txt format.

Balabala0792 commented 2 years ago

Ok, thank you. But there are problems. "WARNING: Config setting: '/enwiki_20180420_300d.txt' not found. Returning None! INFO: Loading word vectors from: None... AttributeError: 'NoneType' object has no attribute 'endswith'" I don't know how to do it and I'm pretty sure it's not a path problem. Hope you can help me. Thanks!