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

Error Loading Model #18

Open
johnludwigm opened this issue Apr 17, 2017 · 1 comment
Open

Error Loading Model #18

johnludwigm opened this issue Apr 17, 2017 · 1 comment

Comments

@johnludwigm
Copy link

I have already viewed [https://github.com//issues/6](this previous issue), but I haven't yet solved my problem.

I downloaded "Wikipedia+Gigaword 5" from https://github.com/3Top/word2vec-api and am trying to open the model. I run model = gensim.models.Word2Vec.load_word2vec_format('glove.6B.300d.txt', binary = False) and I get the following:

Traceback (most recent call last): File "<pyshell#5>", line 1, in <module> model = gensim.models.Word2Vec.load_word2vec_format('glove.6B.300d.txt', binary = False) File "C:\Python35\lib\site-packages\gensim\models\word2vec.py", line 1308, in load_word2vec_format raise DeprecationWarning("Deprecated. Use gensim.models.KeyedVectors.load_word2vec_format instead.") DeprecationWarning: Deprecated. Use gensim.models.KeyedVectors.load_word2vec_format instead.

Ok, so I run model = gensim.models.KeyedVectors.load_word2vec_format('glove.6B.300d.txt', binary = False) and get
Traceback (most recent call last): File "<pyshell#9>", line 1, in <module> model = gensim.models.KeyedVectors.load_word2vec_format('deps.txt', binary = False) File "C:\Python35\lib\site-packages\gensim\models\keyedvectors.py", line 193, in load_word2vec_format vocab_size, vector_size = map(int, header.split()) # throws for invalid file format ValueError: invalid literal for int() with base 10: 'the'

I saw lechatpito's comment in the aforementioned thread and opened the large text file, added "400000 300" and hit enter, then file -> Save As, and saved it as "new_deps.txt".

So I run model = gensim.models.KeyedVectors.load_word2vec_format('new_deps.txt', binary = False) and get

Traceback (most recent call last): File "<pyshell#10>", line 1, in <module> model = gensim.models.KeyedVectors.load_word2vec_format('new_deps.txt', binary = False) File "C:\Python35\lib\site-packages\gensim\models\keyedvectors.py", line 193, in load_word2vec_format vocab_size, vector_size = map(int, header.split()) # throws for invalid file format ValueError: invalid literal for int() with base 10: '\ufeff400000'

and I don't know what to do :(.

@ZilvinasKucinskas
Copy link

ZilvinasKucinskas commented Apr 26, 2017

Same here with common crawl model.

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