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

AttributeError: 'Word2Vec' object has no attribute 'wv' #97

Open
YutingSun163 opened this issue Aug 1, 2019 · 5 comments
Open

AttributeError: 'Word2Vec' object has no attribute 'wv' #97

YutingSun163 opened this issue Aug 1, 2019 · 5 comments

Comments

@YutingSun163
Copy link

When I run main.py, an error occured:
Traceback (most recent call last):
File "main.py", line 168, in
sys.exit(main())
File "main.py", line 165, in main
process(args)
File "main.py", line 101, in process
model.wv.save_word2vec_format(args.output)
AttributeError: 'Word2Vec' object has no attribute 'wv'

My python version is 3.7.0, and gensim version 0.10.2

@GTmac
Copy link
Collaborator

GTmac commented Aug 2, 2019

The gensim version is too old -- please try the latest version of gensim and let me know if that works. Thanks!

@YutingSun163
Copy link
Author

I tried upgrade the gensim version to the latest, but new error occur:

Traceback (most recent call last):
File "main.py", line 17, in
from gensim.models import Word2Vec
File "/Users/apple/Library/Python/3.7/lib/python/site-packages/gensim-3.8.0-py3.7-macosx-10.9-x86_64.egg/gensim/init.py", line 5, in
from gensim import parsing, corpora, matutils, interfaces, models, similarities, summarization, utils # noqa:F401
File "/Users/apple/Library/Python/3.7/lib/python/site-packages/gensim-3.8.0-py3.7-macosx-10.9-x86_64.egg/gensim/parsing/init.py", line 4, in
from .preprocessing import (remove_stopwords, strip_punctuation, strip_punctuation2, # noqa:F401
File "/Users/apple/Library/Python/3.7/lib/python/site-packages/gensim-3.8.0-py3.7-macosx-10.9-x86_64.egg/gensim/parsing/preprocessing.py", line 42, in
from gensim import utils
File "/Users/apple/Library/Python/3.7/lib/python/site-packages/gensim-3.8.0-py3.7-macosx-10.9-x86_64.egg/gensim/utils.py", line 45, in
from smart_open import open
ImportError: cannot import name 'open' from 'smart_open' (/Users/apple/Library/Python/3.7/lib/python/site-packages/smart_open/init.py)

@YutingSun163
Copy link
Author

And also I got error : file not exist: karate.embeddings, although I have manually created one.

@GTmac
Copy link
Collaborator

GTmac commented Aug 10, 2019

Sorry for the late reply. For posterity, it seems that gensim is not properly installed on your machine.

@GTmac
Copy link
Collaborator

GTmac commented Aug 10, 2019

And also I got error : file not exist: karate.embeddings, although I have manually created one.

This is the embeddings file produced by DeepWalk on the Karate graph -- it should not be manually created.

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