Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to dump saved model #437

Closed
hlian188 opened this issue Sep 20, 2022 · 2 comments · Fixed by #438
Closed

Unable to dump saved model #437

hlian188 opened this issue Sep 20, 2022 · 2 comments · Fixed by #438

Comments

@hlian188
Copy link

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

@Aman56
Copy link

Aman56 commented Sep 20, 2022

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

@NicolasHug
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants