Error in streamlit app

Hey guys I am facing the following error while deploying a ML application on Streamlit

Collecting usage statistics. To deactivate, set browser.gatherUsageStats to False.

Trying to unpickle estimator DecisionTreeRegressor from 
version 1.2.2 when using version 1.3.1. 

This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:

2023-10-08 11:17:19.820 Uncaught app exception
Traceback (most recent call last):
  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/", line 541, in _run_script
    exec(code, module.__dict__)
  File "/mount/src/ma0-b/", line 40, in <module>
    bioactivity_first_model = pickle.load(open('pubchem.pkl', 'rb'))
  File "sklearn/tree/_tree.pyx", line 728, in sklearn.tree._tree.Tree.__setstate__
  File "sklearn/tree/_tree.pyx", line 1432, in sklearn.tree._tree._check_node_ndarray
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'), ('threshol

The repository can be found at

Upgrade or modify a version of scikit-learn?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.