Surprise icon indicating copy to clipboard operation
Surprise copied to clipboard

Unable to dump saved model

Open hlian188 opened this issue 3 years ago • 1 comments

Hi there,

When I try to dump a model, I receive the following error: TypeError: no default __reduce__ due to non-trivial __cinit__ I am running a basic model as such:

algo = SVD(verbose = False, n_epochs = 10)
cross_validate(algo, data, measures=['RMSE', 'MAE'], cv=3, verbose = True)
dump.dump("model.pkl", algo = algo)

I even tried pickling without using dump.dump as such to no avail.

with open(file_name, 'wb') as f:
    pickle.dump(algo, f)

Lastly, I created a wrapper class that inherits from the SVD model where I manually wrote in the __reduce__ function. This also did not work. I am very stuck and unsure how to save the model

hlian188 avatar Sep 20 '22 02:09 hlian188

I'm facing the same issue. Thanks for posting.

Aman56 avatar Sep 20 '22 02:09 Aman56

Hi all, I just released version 1.1.3 where this issue should be fixed. Thank you for the reports and please let me know if it still breaks.

NicolasHug avatar Sep 23 '22 18:09 NicolasHug