-
Notifications
You must be signed in to change notification settings - Fork 534
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
Fix trying to get pointer to None in svm/linear.pyx #5615
Fix trying to get pointer to None in svm/linear.pyx #5615
Conversation
/ok to test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yosider Thanks a lot for reporting the issue, providing an MRE and even a proposed fix!
Before we move forward, I think it would be very important that we add a test that captures this bug. I would proposed to add a unit test to the python/cuml/tests/test_pickle.py
module for the LinearSVC
class similar to some of the other tests. Please let me know if you need more guidance!
@csadorf Thanks for your advice! |
/ok to test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks a lot!
@yosider I'll look into the CI test failures which are |
/ok to test |
/merge |
This PR fixes the following bug in
svm/linear.pyx
:After fitting
LinearSVC
and saving it using pickle, attempting to load and runpredict()
(ordecision_function()
andpredict_proba()
that call__sync_model()
) results in the following error:I identified that the issue is caused by attempting to obtain a pointer to a variable with a None value in
LinearSVMWrapper.__cinit__()
. After fixing this and rebuilding, the code worked as expected.Minimal code to reproduce the bug:
If this is not the appropriate way to fix the issue, I would appreciate any corrections.