umap icon indicating copy to clipboard operation
umap copied to clipboard

Recommended way to save umap instances and reliably load it

Open lappalainenj opened this issue 1 year ago • 0 comments

How to save umap instances and reliably load it (also in higher package versions)

I would like to be able to load umap models fitted and pickled in 0.5.3 also in >=0.5.7 to avoid creating a version dependency for these models. Is there a recommended way to save and reload model weights?

Trying to unpickle the umap object in 0.5.7 leads to the following error related to numba:

Traceback (most recent call last):
    saved_data = pickle.load(f)
                 ^^^^^^^^^^^^^^
  File "../lib/python3.11/site-packages/numba/core/serialize.py", line 110, in _unpickle__CustomPickled
    ctor, states = loads(serialized)
                   ^^^^^^^^^^^^^^^^^
TypeError: code() argument 13 must be str, not int

lappalainenj avatar Nov 14 '24 17:11 lappalainenj