Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from gensim.models.keyedvectors import KeyedVectors
- model_path = './data/GoogleNews-vectors-negative300.bin'
- w2v_model = KeyedVectors.load_word2vec_format(model_path, binary=True)
- FileNotFoundError Traceback (most recent call last)
- <ipython-input-16-04e6454088bc> in <module>
- 1 from gensim.models.keyedvectors import KeyedVectors
- 2 model_path = './data/GoogleNews-vectors-negative300.bin'
- ----> 3 w2v_model = KeyedVectors.load_word2vec_format(model_path, binary=True)
- ~AppDataLocalcondacondaenvschannellibsite-packagesgensimmodelskeyedvectors.py in load_word2vec_format(cls, fname, fvocab, binary, encoding, unicode_errors, limit, datatype)
- 1434 return _load_word2vec_format(
- 1435 cls, fname, fvocab=fvocab, binary=binary, encoding=encoding, unicode_errors=unicode_errors,
- -> 1436 limit=limit, datatype=datatype)
- 1437
- 1438 def get_keras_embedding(self, train_embeddings=False):
- ~AppDataLocalcondacondaenvschannellibsite-packagesgensimmodelsutils_any2vec.py in _load_word2vec_format(cls, fname, fvocab, binary, encoding, unicode_errors, limit, datatype)
- 169
- 170 logger.info("loading projection weights from %s", fname)
- --> 171 with utils.smart_open(fname) as fin:
- 172 header = utils.to_unicode(fin.readline(), encoding=encoding)
- 173 vocab_size, vector_size = (int(x) for x in header.split()) # throws for invalid file format
- ~AppDataLocalcondacondaenvschannellibsite-packagessmart_opensmart_open_lib.py in smart_open(uri, mode, **kw)
- 398 transport_params[key] = value
- 399
- --> 400 return open(uri, mode, ignore_ext=ignore_extension, transport_params=transport_params, **scrubbed_kwargs)
- 401
- 402
- ~AppDataLocalcondacondaenvschannellibsite-packagessmart_opensmart_open_lib.py in open(uri, mode, buffering, encoding, errors, newline, closefd, opener, ignore_ext, transport_params)
- 298 buffering=buffering,
- 299 encoding=encoding,
- --> 300 errors=errors,
- 301 )
- 302 if fobj is not None:
- ~AppDataLocalcondacondaenvschannellibsite-packagessmart_opensmart_open_lib.py in _shortcut_open(uri, mode, ignore_ext, buffering, encoding, errors)
- 457 #
- 458 if six.PY3:
- --> 459 return _builtin_open(parsed_uri.uri_path, mode, buffering=buffering, **open_kwargs)
- 460 elif not open_kwargs:
- 461 return _builtin_open(parsed_uri.uri_path, mode, buffering=buffering)
- FileNotFoundError: [Errno 2] No such file or directory: './data/GoogleNews-vectors-negative300.bin'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement