Skip to content

Gensim And Compatibility

Radim Řehůřek edited this page Mar 24, 2021 · 15 revisions

Upgrading Python

Gensim supports any Python that's before its end-of-life:

Current (supported) Pythons are automatically tested via Gensim's continuous integration (CI) system.

Upgrading Gensim

Gensim follows "semantic versioning": major.minor.bugfix, though not fanatically. Always read the release notes carefully!

To upgrade to the latest release, simply run

pip install --upgrade gensim

For power users, if you want to try a pre-release (beta, release candidate):

pip install --upgrade --pre gensim

Upgrading trained models

Users store Gensim models using Gensim's native .save() and .load() methods.

After you upgrade Gensim, your serialized model may be out-of-date: the new Gensim release may have added/removed some attributes, or made other changes.

To cut down maintenance effort, Gensim only guarantees (and automatically tests) compatibility between successive major releases. That is, a model stored in Gensim 4.X is guaranteed to load in 4.(X+1). But not necessarily in 4.(X+2), 4.(X+3), etc.

Loading older models may work too, but Gensim is an open source project run by volunteers and we cannot promise anything more.

Your other option is to re-train your model from scratch with each Gensim upgrade. This may offer additional benefits, because new versions fix bugs, improve accuracy, runtime & memory, etc.