rapidsai / cuml

cuML - RAPIDS Machine Learning Library
https://docs.rapids.ai/api/cuml/stable/
Apache License 2.0
4.25k stars 534 forks source link

[BUG] model save problem in cuml #6069

Open skyqwe123 opened 2 months ago

skyqwe123 commented 2 months ago

@msarahan @seberg @benfred @mattf Thanks for your good job! When i use cuml, the model can not be saved like sklearn.

Describe the bug Models cannot be saved like sklearn.

if we use sklearn, it works: import torch from sklearn import random_projection model = random_projection.SparseRandomProjection(eps=0.1) torch.save(model, 'model.pkl')

in cuml it not work and give following error: import cuml model = cuml.random_projection.SparseRandomProjection(eps=0.1) torch.save(model, 'model.pkl')

TypeError: self.rand_matD,self.rand_matS cannot be converted to a Python object for pickling

dantegd commented 1 month ago

Thanks for the issue @skyqwe123, I haven't used torch.save before with sklearn estimators, seems like it relies in pickle so this must be exposing a bug in our pickling of Spars Random Projection, so this is something we will work in but don't have an ETA currently.