Skip to content

Gensim And Compatibility

Radim Řehůřek edited this page Oct 16, 2020 · 15 revisions

Upgrading Python

Gensim supports any Python before its end-of-life:

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

Upgrading Gensim

Gensim uses "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

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.

For this reason, each new Gensim release (minor or major, starting with Gensim 4.0) comes with a "model upgrade" script:

python -m gensim.scripts.upgrade_model_4.3_to_4.4 /path/to/old_model.gensim /path/to/new_model.gensim 

This will upgrade a model stored with an immediately preceding Gensim version (e.g. 4.3) to the current version (e.g. 4.4), and store it under a new filename.

If you have a model serialized several versions back (e.g. 4.1), you'll have to upgrade in multiple hops: 4.1 => 4.2 => 4.3 => 4.4. Or re-train your model from scratch.

Clone this wiki locally