LaVOZs

The World’s Largest Online Community for Developers

'; python - Exception: Cannot load model.bin - LavOzs.Com

I have got the following error message trying to run a model:

Exception: fastText: Cannot load model.bin due to C++ extension failed to allocate the memory

The code I have used is the following:

import wget
from fasttext import load_model

wget.download("https://dl.fbaipublicfiles.com/fasttext/supervised-models/amazon_review_polarity.bin", 'model.bin')

model = load_model("model.bin")

I have tried to follow this answer: FastText - Cannot load model.bin due to C++ extension failed to allocate the memory but probably I am doing something wrong as the error is still there. Any idea on how to fix it?

Related
How do I check whether a file exists without exceptions?
Proper way to declare custom exceptions in modern Python?
Manually raising (throwing) an exception in Python
Catch multiple exceptions in one line (except block)
Import Error: No module named numpy
Gensim FastText - KeyError: “word not in vocabulary”
FastText .bin file cannot fit in memory, even though I have enough RAM
Issues while loading a trained fasttext model using gensim
Python Gensim FastText Saving and Loading Model
Sentiment analysis and fasttext: import error