fl@50958caeca7b:/tmp1/ros_ws$ ros2 run cargo_detect_py detect
/home/fl/.local/lib/python3.10/site-packages/sklearn/utils/_param_validation.py:11: UserWarning: A NumPy version >=1.23.5 and <2.3.0 is required for this version of SciPy (detected version 1.21.5)
from scipy.sparse import csr_matrix, issparse
/home/fl/.local/lib/python3.10/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
warnings.warn(
Traceback (most recent call last):
File "/tmp1/ros_ws/install/cargo_detect_py/lib/cargo_detect_py/detect", line 33, in
sys.exit(load_entry_point('cargo-detect-py==0.0.0', 'console_scripts', 'detect')())
File "/tmp1/ros_ws/install/cargo_detect_py/lib/python3.10/site-packages/cargo_detect_py/test01.py", line 119, in main
lidar_storage_detection = LidarStorageDetection()
File "/tmp1/ros_ws/install/cargo_detect_py/lib/python3.10/site-packages/cargo_detect_py/test01.py", line 22, in init
self.model = joblib.load('/tmp1/ros_ws/lidar_SVM_model_limited.pkl')
File "/home/fl/.local/lib/python3.10/site-packages/joblib/numpy_pickle.py", line 658, in load
obj = _unpickle(fobj, filename, mmap_mode)
File "/home/fl/.local/lib/python3.10/site-packages/joblib/numpy_pickle.py", line 577, in _unpickle
obj = unpickler.load()
File "/usr/lib/python3.10/pickle.py", line 1213, in load
dispatchkey[0]
File "/home/fl/.local/lib/python3.10/site-packages/joblib/numpy_pickle.py", line 402, in load_build
Unpickler.load_build(self)
File "/usr/lib/python3.10/pickle.py", line 1718, in load_build
setstate(state)
File "_tree.pyx", line 867, in sklearn.tree._tree.Tree.setstate
File "_tree.pyx", line 1573, 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'), ('threshold', '<f8'), ('impurity', '<f8'), ('n_node_samples', '<i8'), ('weighted_n_node_samples', '<f8')]
[ros2run]: Process exited with failure 1
解析一下报错