如何修复Joblib中的“ TypeError:无法腌制cv2.xfeatures2d_SIFT对象”错误

时间:2019-11-12 04:15:51

标签: python opencv sift joblib

我需要保存sift_object并重新加载,但是joblib库出现错误

>>> sift = cv.xfeatures2d.SIFT_create()

>>> joblib.dump(sift, 'output/sift_model')


Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/phvien/PycharmProjects/leaf-disease-detection/venv/lib/python3.6/site-packages/joblib/numpy_pickle.py", line 502, in dump
    NumpyPickler(f, protocol=protocol).dump(value)
  File "/usr/lib/python3.6/pickle.py", line 409, in dump
    self.save(obj)
  File "/home/phvien/PycharmProjects/leaf-disease-detection/venv/lib/python3.6/site-packages/joblib/numpy_pickle.py", line 292, in save
    return Pickler.save(self, obj)
  File "/usr/lib/python3.6/pickle.py", line 496, in save
    rv = reduce(self.proto)

TypeError: can't pickle cv2.xfeatures2d_SIFT objects

0 个答案:

没有答案