-
Notifications
You must be signed in to change notification settings - Fork 77
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
Models created with different scikit-learn versions break compatibility #1195
Comments
latest action for python 3.11 installs scikit-learn v1.2.2 as required: so did v0.10.5: |
Ok, strange. |
mamba create -c conda-forge -n lstchain-v0.10.5 python=3.11 lstchain=0.10.5 is actually giving me problems in both linux and macos:
|
The package definitely exists: |
works fine |
ok, lets close then. |
Just a correction on this. It actually worked fine on linux, but not on macos (my bad!) |
The problem is still there. setup.py requires: 'scikit-learn~=1.2' which means the latest available among 1.x not 1.2.x, while env yml file installs scikit-learn=1.2 (1.2.2 more precisely). The CI uses the env yml to setup the environment. Later it does Models created with scikit-learn 1.2.2 cannot be read with newer versions: In dl1 to dl2 command: /fefs/aswg/software/conda/envs/foa/lib/python3.9/site-packages/sklearn/base.py:376: InconsistentVersionWarning: Trying to unpickle estimator DecisionTreeRegressor from version 1.2.2 when using version 1.5.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:
https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations
...
ValueError: node array from the pickle has an incompatible dtype:
- expected: {'names': ['left_child', 'right_child', 'feature', 'threshold', 'impurity', 'n_node_samples', 'weighted_n_node_samples', 'missing_go_to_left'], 'formats': ['<i8', '<i8', '<i8', '<f8', '<f8', '<i8', '<f8', 'u1'], 'offsets': [0, 8, 16, 24, 32, 40, 48, 56], 'itemsize': 64}
- got : [('left_child', '<i8'), ('right_child', '<i8'), ('feature', '<i8'), ('threshold', '<f8'), ('impurity', '<f8'), ('n_node_samples', '<i8'), ('weighted_n_node_samples', '<f8')] So I think we should fix the sklearn version in setup.py |
Can anyone cross-check if generating a clean mamba create installs scikit-learn=1.3.2. In my case it seems to be doing that (despite seeing that in the environment in the main version it is forced 1.2). It results in a non-working lstchain environment
Steps:
Errors I was getting using that version of sklearn through the dl1_to_dl2
The text was updated successfully, but these errors were encountered: