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

node array from the pickle #1

Open
thisLoisWong opened this issue Jul 19, 2024 · 1 comment
Open

node array from the pickle #1

thisLoisWong opened this issue Jul 19, 2024 · 1 comment

Comments

@thisLoisWong
Copy link

thisLoisWong commented Jul 19, 2024

I encountered this error while deploying pySiRC. The streamlit forum is looking for solutions, and most of the answers are that the environment for deploying the model needs to have the same scikit-learn version as the environment for generating the model. What is the scikit-learn version of the development environment?
Uploading 屏幕截图 2024-07-19 115655.png…

@thisLoisWong
Copy link
Author

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')]
Traceback:
File "C:\Users\王懋凡\AppData\Local\Programs\Python\Python311\Lib\site-packages\streamlit\script_runner.py", line 354, in _run_script
exec(code, module.dict)
File "C:\Users\王懋凡\Desktop\pySiRC-master\pySiRC\pySiRC.py", line 887, in
run = FrontEnd()
^^^^^^^^^^
File "C:\Users\王懋凡\Desktop\pySiRC-master\pySiRC\pySiRC.py", line 309, in init
super().init()
File "C:\Users\王懋凡\Desktop\pySiRC-master\pySiRC\pySiRC.py", line 89, in init
BackEnd.__load_models(self)
File "C:\Users\王懋凡\Desktop\pySiRC-master\pySiRC\pySiRC.py", line 131, in __load_models
self.kOH_morgan_rf = pickle.load(open(path_kOH_morgan_rf, 'rb'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "_tree.pyx", line 867, in sklearn.tree._tree.Tree.setstate
File "_tree.pyx", line 1573, in sklearn.tree._tree._check_node_ndarray

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

No branches or pull requests

1 participant