0

I'm loading pretrained Doc2Vec model using:

from gensim.models import Doc2Vec
model = Doc2Vec.load('/path/to/pretrained/model')

I'm getting the following error:

AttributeError: 'module' object has no attribute 'call_on_class_only'

Does anyone know how to fix it. The model was trained with gensim 0.13.3 and I'm using gensim 0.12.4.

kennytm
  • 510,854
  • 105
  • 1,084
  • 1,005
Regina
  • 115
  • 4
  • 13

1 Answers1

2

Gensim will generally try to support loading of models saved from older versions into newer versions – but the reverse is a much harder problem, and will only work sometimes.

So upgrade the environment where you want to load the model to 0.13.3, to match where it was trained. (Or try the most-recent version, 1.0.1.) But don't try to move models backwards.

gojomo
  • 52,260
  • 14
  • 86
  • 115
  • @Regina If you click the gray check-mark alongside this answer, it will make it clear that this question has been adequately answered when it appears in lists-of-questions. That will save me and others occasional click-revisits, when it appears to still be needing-an-answer. – gojomo May 15 '17 at 22:34