Closed imatheussm closed 2 years ago
I think this happens because the ivis models are being pickled just after creation, before they are fitted - the current logic for save_model
and load_model
don't allow for saving models that aren't fitted. Probably cleanest way to fix is add that logic to those methods. Will have a closer look.
Pushed a new branch https://github.com/beringresearch/ivis/tree/untrained-model-persistance that should solve this issue. Still need to add some tests to validate, then will merge and release fix.
Thanks for raising this issue, this is definitely a nice feature to have.
Merged into master with https://github.com/beringresearch/ivis/commit/690d610d62be786b7a9a98debe57129bae678095
Thanks again for bringing this to our attention - slipped through the cracks in the refactor.
The issue
Whenever using
sklearn.model_selection.GridSearch
with asklearn.pipeline.Pipeline
containingivis.Ivis
andGridSearch
is set withn_jobs != -1
(e.g.,n_jobs = 2
), errors happen. Whenn_jobs = 1
, no errors occur.Minimal reproducible example
Environment
A virtual environment was created specifically for this project, wherein all modules specified in
requirements.txt
were installed. My setup runs an up-to-date version of Windows 10 (no WSL). My local repository was based on a50b196735eecc2afc63423fe99b803107048572.Runtime
Relevant modules
Example with
sklearn.pipeline.Pipeline
Script
Log with errors
Discussion
To the best of my knowledge and local testing, this issue seems to appear after the resolution of #101 with #106. Since the logic for pickling and unpickling
Ivis
instances was improved, my belief is that this particular use case was not covered neither by the new implementation, nor by the newly added test cases. I reserved some time today to investigate this further, but so far, I was out of luck. Do you have any thoughts on this? Perhaps we could also create additional tests covering scenarios whereinPipeline
andGridSearchCV
are used. Does this make sense?Thank you beforehand for your support.