Sep-19-2024, 03:30 PM
Hi,
I'm trying to open an old joblib file built by a previous engineer at my work but I have minimal Python experience. I know the model was trained in 2022, and I'm using PyCharm with Python 3.8 and the following packages:
Package Version
------------- -------
joblib 1.0.1
numpy 1.19.0
pip 21.3
scikit-learn 0.23.2
scipy 1.6.3
setuptools 75.1.0
sklearn 0.0
threadpoolctl 3.5.0
wheel 0.44.0
From what I could find, they should all be compatible. Then I ran this code after importing joblib and received the following error:
>> filename = 'model.joblib'
>> model = joblib.load(filename)
I'm trying to open an old joblib file built by a previous engineer at my work but I have minimal Python experience. I know the model was trained in 2022, and I'm using PyCharm with Python 3.8 and the following packages:
Package Version
------------- -------
joblib 1.0.1
numpy 1.19.0
pip 21.3
scikit-learn 0.23.2
scipy 1.6.3
setuptools 75.1.0
sklearn 0.0
threadpoolctl 3.5.0
wheel 0.44.0
From what I could find, they should all be compatible. Then I ran this code after importing joblib and received the following error:
>> filename = 'model.joblib'
>> model = joblib.load(filename)
Error:Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Users\masonml\AppData\Local\Programs\Python\Python38-32\lib\site-packages\joblib\numpy_pickle.py", line 585, in load
obj = _unpickle(fobj, filename, mmap_mode)
File "C:\Users\masonml\AppData\Local\Programs\Python\Python38-32\lib\site-packages\joblib\numpy_pickle.py", line 504, in _unpickle
obj = unpickler.load()
File "C:\Users\masonml\AppData\Local\Programs\Python\Python38-32\lib\pickle.py", line 1210, in load
dispatch[key[0]](self)
File "C:\Users\masonml\AppData\Local\Programs\Python\Python38-32\lib\site-packages\joblib\numpy_pickle.py", line 329, in load_build
Unpickler.load_build(self)
File "C:\Users\masonml\AppData\Local\Programs\Python\Python38-32\lib\pickle.py", line 1703, in load_build
setstate(state)
File "sklearn\neighbors\_binary_tree.pxi", line 1160, in sklearn.neighbors._kd_tree.BinaryTree.__setstate__
File "sklearn\neighbors\_binary_tree.pxi", line 1102, in sklearn.neighbors._kd_tree.BinaryTree._update_memviews
File "sklearn\neighbors\_binary_tree.pxi", line 215, in sklearn.neighbors._kd_tree.get_memview_ITYPE_1D
ValueError: Buffer dtype mismatch, expected 'ITYPE_t' but got 'long long'