【发布时间】:2021-09-07 08:51:01
【问题描述】:
trial.py 中的 Python 代码:
import sent2vec
model_path = 'BioSentVec/BioSentVec_PubMed_MIMICIII-bigram_d700.bin'
model = sent2vec.Sent2vecModel()
try:
model.load_model(model_path)
except Exception as e:
print(e)
在命令行运行:
$ python3 trial.py
输出:
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted (core dumped)
BioSentVec 嵌入是 22GB,我有 46GB 可用。基于 fasttext 的模型。运行 Ubuntu 20.04 LTS。使用 conda 环境 - 安装一些旧版本的依赖项时遇到问题。 任何有关使嵌入将句子转换为向量的帮助将不胜感激, 谢谢大家。
【问题讨论】:
标签: python ubuntu-20.04 word-embedding fasttext bad-alloc