Gensim:加载预训练的 doc2vec 模型时出错?
Gensim: error while loading pretrained doc2vec model?
我正在使用以下方式加载预训练的 Doc2Vec 模型:
from gensim.models import Doc2Vec
model = Doc2Vec.load('/path/to/pretrained/model')
我收到以下错误:
AttributeError: 'module' object has no attribute 'call_on_class_only'
有谁知道如何修复它。该模型是使用 gensim 0.13.3 训练的,我使用的是 gensim 0.12.4。
Gensim 通常会尝试支持将从 旧 版本保存的模型加载到 较新 版本中——但反过来是一个更难的问题,并且只会有时工作。
因此,将要加载模型的环境升级到 0.13.3,以匹配它的训练位置。 (或尝试最新版本 1.0.1。)但不要尝试向后移动模型。
我正在使用以下方式加载预训练的 Doc2Vec 模型:
from gensim.models import Doc2Vec
model = Doc2Vec.load('/path/to/pretrained/model')
我收到以下错误:
AttributeError: 'module' object has no attribute 'call_on_class_only'
有谁知道如何修复它。该模型是使用 gensim 0.13.3 训练的,我使用的是 gensim 0.12.4。
Gensim 通常会尝试支持将从 旧 版本保存的模型加载到 较新 版本中——但反过来是一个更难的问题,并且只会有时工作。
因此,将要加载模型的环境升级到 0.13.3,以匹配它的训练位置。 (或尝试最新版本 1.0.1。)但不要尝试向后移动模型。