-
-
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
'FastTextTrainables' object has no attribute 'vectors' #2062
Comments
Same issue here, why does it save 3 different files and why do we get his error message? Pushing please! |
CC @manneshiva |
This is how my case looks like and the following error message (demonstrating from within iPython console):
In my directory I do have both files "wiki.en.vec" and "wiki.en.bin".
Note: I takes extremely long to load the model in the first place. It is really annoying is that normal? What is the binary file there for, loading the gensim binary file which I generated from first reading the .vec file and than saving as Word2Vec gensim format only takes 45secs BUT it is not able to handle OOV words, therefore I really need to be able to load this model with the method showed below as I thought it should be way faster to load ones the model was build and saved.
Why the hell does it generate 3 files?! Can you guys please explain the reason behind that? I really do not understand this!
Side notes:
Thanks @piskvorky and @manneshiva for hopefully solving that issue quite soon! |
@rpedela thanks for the report, reproduced with similar trace AttributeError Traceback (most recent call last)
<ipython-input-2-a1c692ae9dff> in <module>()
----> 1 m = FastText.load("gensim_en_fasttext_wiki_lg")
/home/ivan/.virtualenvs/math/local/lib/python2.7/site-packages/gensim/models/fasttext.pyc in load(cls, *args, **kwargs)
901 logger.info('Model saved using code from earlier Gensim Version. Re-loading old model in a compatible way.')
902 from gensim.models.deprecated.fasttext import load_old_fasttext
--> 903 return load_old_fasttext(*args, **kwargs)
904
905 @deprecated("Method will be removed in 4.0.0, use self.wv.accuracy() instead")
/home/ivan/.virtualenvs/math/local/lib/python2.7/site-packages/gensim/models/deprecated/fasttext.pyc in load_old_fasttext(*args, **kwargs)
51
52 def load_old_fasttext(*args, **kwargs):
---> 53 old_model = FastText.load(*args, **kwargs)
54 params = {
55 'size': old_model.vector_size,
/home/ivan/.virtualenvs/math/local/lib/python2.7/site-packages/gensim/models/deprecated/word2vec.pyc in load(cls, *args, **kwargs)
1615 @classmethod
1616 def load(cls, *args, **kwargs):
-> 1617 model = super(Word2Vec, cls).load(*args, **kwargs)
1618 # update older models
1619 if hasattr(model, 'table'):
/home/ivan/.virtualenvs/math/local/lib/python2.7/site-packages/gensim/models/deprecated/old_saveload.pyc in load(cls, fname, mmap)
85 compress, subname = SaveLoad._adapt_by_suffix(fname)
86
---> 87 obj = unpickle(fname)
88 obj._load_specials(fname, mmap, compress, subname)
89 logger.info("loaded %s", fname)
/home/ivan/.virtualenvs/math/local/lib/python2.7/site-packages/gensim/models/deprecated/old_saveload.pyc in unpickle(fname)
380 return _pickle.loads(file_bytes, encoding='latin1')
381 else:
--> 382 return _pickle.loads(file_bytes)
383
384
AttributeError: 'module' object has no attribute 'FastTextVocab'
That's expected, we already have an issue for it #1261
The model contains 2 matrices ( |
Any progress on this? I hoped that saving in gensim format and loading would result in faster load times. Alas,
|
Can be related to #2160 |
Fixed by #2313 |
Using the pre-trained FastText English Wikipedia model, I load it and then save it to gensim's format. When I load the new file, I get a
'FastTextTrainables' object has no attribute 'vectors'
error. I am using version 3.4.0.Saved Files
Error
The text was updated successfully, but these errors were encountered: