异常:无法加载model.bin。无法加载model.bin

问题描述 投票:0回答:1

我在尝试运行一个模型时得到了以下错误信息。

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

我使用的代码如下

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")

我试着按照这个答案去做。FastText - Cannot load model.bin due to C++ extension failed to allocate the memory. 但可能是我做错了什么,因为这个错误仍然存在。有什么办法可以解决这个问题吗?

python sentiment-analysis fasttext
1个回答
1
投票

按照以下步骤安装最新版本的fasttext (0.9.2)。

git clone https://github.com/facebookresearch/fastText.git
cd fastText
pip install .

然后试着执行你的代码 它应该可以工作。

© www.soinside.com 2019 - 2024. All rights reserved.