I'm trying to load one of the FastText pre-trained models that has a form of a .bin file. The size of .bin file is 2.8GB and I have 8GB RAM and 8GB swap file. Unfortunately, the model starts loading and it occupies almost 15GB and then it breaks with the following error:
Process finished with exit code 137 (interrupted by signal 9: SIGKILL)
By observing the system monitor, I can see that RAM and swap are fully occupied, so I think it breaks because it is out of memory.
I'm trying to load the file using Gensim wrapper for FastText
from gensim.models.wrappers import FastText
model = FastText.load_fasttext_format('../model/java_ftskip_dim100_ws5')
My questions are the following:
1) Is there any way to fit this model in the current memory of my system?
2) Is it possible to reduce the size of this model? I tried the quantization using the following code
./fasttext quantize -output java_ftskip_dim100_ws5 -input unused_argument.txt
And I'm getting the following error:
terminate called after throwing an instance of 'std::invalid_argument'
what(): For now we only support quantization of supervised models
Aborted (core dumped)
I would really appreciate your help!