Skip to content
Advertisement

Saving and Loading a Vowpal Wabbit model in python with –safe_resume –cb_explore

I would like to do online training with a contextual Vowpal Wabbit model, so I need to save and reload frequently. However, whenever I try to reload a model (which was initialized with –save_resume), I get an exception with:

JavaScript

Example Code to reproduce:

JavaScript

Python 3.8.5 vowpalwabbit==8.10.1

If I don’t use –save_resume, load and save work, however the model performance is not as good. I would love to just do pickle.dump(vw) but that gives me a RuntimeError: RuntimeError: Pickling of "vowpalwabbit.pyvw.vw" instances is not enabled

Related articles: what exactly does the `–save_resume` option in vowpal wabbit do https://github.com/VowpalWabbit/vowpal_wabbit/issues/1040

Advertisement

Answer

The problem was resolved in a bugfix: https://github.com/VowpalWabbit/vowpal_wabbit/issues/3062

vowpalwabbit 8.10.2 has been released on PyPi

Advertisement