Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FastText - Cannot load model.bin due to C++ extension failed to allocate the memory

I'm trying to use the FastText Python API https://pypi.python.org/pypi/fasttext Although, from what I've read, this API can't load the newer .bin model files at https://github.com/facebookresearch/fastText/blob/master/pretrained-vectors.md as suggested in https://github.com/salestock/fastText.py/issues/115

I've tried everything that is suggested at that issue, and furthermore https://github.com/Kyubyong/wordvectors doesn't have the .bin for English, otherwise the problem would be solved. Does anyone know of a work-around for this?

like image 872
Filipe Avatar asked Aug 28 '17 16:08

Filipe


2 Answers

Try the following steps to solve the issue. Its worked with me for Python 3.5 while loading a language identification model.

git clone https://github.com/facebookresearch/fastText.git
cd fastText
pip install .
like image 196
Barathi Ganesh HB Avatar answered Sep 20 '22 04:09

Barathi Ganesh HB


You can't use the package fasttext installed by pip. You use install fastText (capital T) from fasttext repo.

like image 32
James Ma Avatar answered Sep 18 '22 04:09

James Ma