skip-thoughts icon indicating copy to clipboard operation
skip-thoughts copied to clipboard

DeprecationWarning: Deprecated. Use gensim.models.KeyedVectors.load_word2vec_format instead.

Open dakshvar22 opened this issue 7 years ago • 2 comments

We have changed the line to load model to gensim.models.KeyedVectors.load_word2vec_format, still we are getting the following error

import tools embed_map = tools.load_googlenews_vectors() model = tools.load_model(embed_map)

DeprecationWarning Traceback (most recent call last) in () 1 import tools ----> 2 embed_map = tools.load_googlenews_vectors() 3 model = tools.load_model(embed_map)

/home/mpl2/daksh/tarun/skip-thoughts/training/tools.pyc in load_googlenews_vectors() 154 155 embed_map = gensim.models.KeyedVectors.load_word2vec_format(path_to_word2vec, binary=True) --> 156 return embed_map 157 158 def lookup_table(options, embed_map, worddict, word_idict, f_emb, use_norm=False):

/usr/local/lib/python2.7/dist-packages/gensim/models/word2vec.pyc in load_word2vec_format(cls, fname, fvocab, binary, encoding, unicode_errors, limit, datatype) 1446 limit=None, datatype=REAL): 1447 """Deprecated. Use gensim.models.KeyedVectors.load_word2vec_format instead.""" -> 1448 raise DeprecationWarning("Deprecated. Use gensim.models.KeyedVectors.load_word2vec_format instead.") 1449 1450 def save_word2vec_format(self, fname, fvocab=None, binary=False):

DeprecationWarning: Deprecated. Use gensim.models.KeyedVectors.load_word2vec_format instead.

dakshvar22 avatar May 06 '17 09:05 dakshvar22

I faced the same problem and I fixed it in the following way -

  • The import statement import gensim.models.keyedvectors as word2vec
  • In load_googlenews_vectors method embed_map = word2vec.KeyedVectors.load_word2vec_format(path_to_word2vec, binary=True)

aayushsanghavi avatar Oct 23 '17 08:10 aayushsanghavi

The path_to_word to bed is returning error no file exist why

naspuka avatar May 15 '19 11:05 naspuka