-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
'Word2Vec' object has no attribute 'trainables' #2000
Comments
Thanks for report @narrowsnap, what I need now
|
I have solved this problem and it is caused by the gensim version being too high. When I lower the gensim version, this error no longer appears |
I used other tutorial's trained model. And it's worked when I use gensim version 3.0.0. |
@menshikh-iv @manneshiva @janpom there are many reported errors with Word2Vec compatibility. What is going on? Is it because of the refactoring—are our tests insufficient? |
@narrowsnap share model please, this is very important for us @piskvorky I think so (but I'm not 100% sure because nobody shares a model yet, this is important for reproducing & fixing). Most of this report exactly similar (i.e. this is 1-2 bugs). Testing is definitely insufficient, because:
This points not only about w2v-based models, this is about all models that we provided. |
@narrowsnap unfortunately, this not a full model, you need to share also |
@menshikh-iv https://drive.google.com/open?id=1h_ybqS3ozjRqquesd5I7MHbwirXzDXzr |
…g old Gensim versions. Fix piskvorky#2000, piskvorky#1977 (piskvorky#2012) * adds default values for attributes * ignore values for attributes that do not exist * adds unit test * fixes default values for missing attributes for older gensim models * adds unit test cases for loading really old gensim models * adds test cases for loading all old models * adds more tests post loading * handles loading d2v models saved using version <=0.12.2 * fix `max_rawint` value and PEP8 errors * adds saving and loading back tests * adds comments and fixes `max_rawint` * fix PEP8
Still having this issue with: Here is the traceback: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): On the other hand, there is no issue on another server with: |
Thanks @enricopal, this related to #1777 refactoring (for this reason. no error with As workaround, you should use older gensim version. |
@enricopal This bug was fixed in #2012 which was released as a part of Gensim |
@manneshiva you are partially right:
from gensim.models import Doc2Vec
# load model from http://data.dws.informatik.uni-mannheim.de/rdf2vec/models/DBpedia/2015-10/8depth/skipgram/
m = Doc2Vec.load("DB2Vec_sg_200_5_5_15_4_500", mmap="r") this code raise
@enricopal in your case, using 3.2.0 are best workaround for now. |
@menshikh-iv I do not think that the model that @enricopal is trying to load ( http://data.dws.informatik.uni-mannheim.de/rdf2vec/models/DBpedia/2015-10/8depth/skipgram/) is a
which confirms that he is trying to load a Also, just to note, in #2012 , we have added tests to load every saved |
@manneshiva nice catch, you are correct! ivan@P50:~/Downloads$ hexdump -C DB2Vec_sg_200_5_5_15_4_500 | head
00000000 80 02 63 67 65 6e 73 69 6d 2e 6d 6f 64 65 6c 73 |..cgensim.models|
00000010 2e 77 6f 72 64 32 76 65 63 0a 57 6f 72 64 32 56 |.word2vec.Word2V|
00000020 65 63 0a 71 01 29 81 71 02 7d 71 03 28 55 0b 74 |ec.q.).q.}q.(U.t|
00000030 72 61 69 6e 5f 63 6f 75 6e 74 71 04 4b 01 55 0b |rain_countq.K.U.|
00000040 62 61 74 63 68 5f 77 6f 72 64 73 71 05 4d 10 27 |batch_wordsq.M.'|
00000050 55 09 63 62 6f 77 5f 6d 65 61 6e 71 06 4b 01 55 |U.cbow_meanq.K.U|
00000060 06 72 61 6e 64 6f 6d 71 07 63 6e 75 6d 70 79 2e |.randomq.cnumpy.|
00000070 72 61 6e 64 6f 6d 0a 5f 5f 52 61 6e 64 6f 6d 53 |random.__RandomS|
00000080 74 61 74 65 5f 63 74 6f 72 0a 71 08 29 52 71 09 |tate_ctor.q.)Rq.|
00000090 28 55 07 4d 54 31 39 39 33 37 71 0a 63 6e 75 6d |(U.MT19937q.cnum| from gensim.models import Word2Vec
m = Word2Vec.load("DB2Vec_sg_200_5_5_15_4_500", mmap='r')
print(m.wv['dbr:Rodier']) example above works correctly, no issues here. |
Description
I got this:
Versions
I used gensim version 3.4.0, python version 3.5.2
Please share your model (very important for reproducing your error)
What should I do for this?
What's a python and OS?
ubuntu16.04LTS
The text was updated successfully, but these errors were encountered: