aditya-grover / node2vec

http://snap.stanford.edu/node2vec/
MIT License
2.61k stars 912 forks source link

Issue with running example from Git #14

Closed cfalconer74 closed 7 years ago

cfalconer74 commented 7 years ago

Hello, I've been stuck on this problem for a a few hours and I'm not sure how to resolve it. :::

(py34) coryfalconer@Opti:~/Documents/Graph/HBDSCAN_testing/Node2vec/node2vec$ python src/main.py --input graph/karate.edgelist --output emb/karate.emd)

The above gives me the following errors:

./home/coryfalconer/anaconda3/envs/py34/lib/python3.4/site-packages/gensim/utils.py:1015: UserWarning: Pattern library is not installed, lemmatization won't be available. warnings.warn("Pattern library is not installed, lemmatization won't be available.") Walk iteration: 1 / 10 2 / 10 3 / 10 4 / 10 5 / 10 6 / 10 7 / 10 8 / 10 9 / 10 10 / 10 Exception in thread Thread-9: Traceback (most recent call last): File "/home/coryfalconer/anaconda3/envs/py34/lib/python3.4/threading.py", line 911, in _bootstrap_inner self.run() File "/home/coryfalconer/anaconda3/envs/py34/lib/python3.4/threading.py", line 859, in run self._target(*self._args, **self._kwargs) File "/home/coryfalconer/anaconda3/envs/py34/lib/python3.4/site-packages/gensim/models/word2vec.py", line 822, in job_producer sentence_length = self._raw_word_count([sentence]) File "/home/coryfalconer/anaconda3/envs/py34/lib/python3.4/site-packages/gensim/models/word2vec.py", line 747, in _raw_word_count return sum(len(sentence) for sentence in job) File "/home/coryfalconer/anaconda3/envs/py34/lib/python3.4/site-packages/gensim/models/word2vec.py", line 747, in return sum(len(sentence) for sentence in job) TypeError: object of type 'map' has no len()

Initially, I had been running the code using Python 3.6 but found that the version of gensim I am using (0.13.3) did not support Python 3.6. I checked to see which versions of python gensim(0.13.3) were available and found that Python 2.6, 2.7, 3.3, 3.4 and 3.5 are all supported. I then proceeded to create three virtual environment with anaconda using python versions 3.3, 3.4, and 3.5 and tried to run the code again though I keep receiving the same issue as above.

If you could shed any light on how to fix this, that would be greatly appreciated.

Thanks! Cory

cfalconer74 commented 7 years ago

Fixed.

Kiris-tingna commented 6 years ago

how to fixed it?