在32位树莓派上打开使用64位机器训练的模型

时间:2017-11-16 06:21:57

标签: python scikit-learn raspberry-pi virtualenv 32bit-64bit

我在测试使用64位机器在32位树莓派上训练的模型时遇到此错误。

此问题已被问过两年,但仍然没有答案。

1)scikits-learn-randomforrest-trained-on-64bit-python-wont-open-on-32bit-python

2)workaround-for-32-64-bit-serialization-exception-on-sklearn-randomforest-model

所以要解决问题如果我必须用32位训练模型,那么如何在64位机器上为它创建虚拟环境呢?

Traceback (most recent call last):
  File "main_radar.py", line 49, in <module>
    DT1 = joblib.load('models/DT1.sav')
  File "/usr/local/lib/python2.7/dist-
packages/sklearn/externals/joblib/numpy_pickle.py", line 578, in load
    obj = _unpickle(fobj, filename, mmap_mode)
  File "/usr/local/lib/python2.7/dist-
packages/sklearn/externals/joblib/numpy_pickle.py", line 508, in 
_unpickle
    obj = unpickler.load()
  File "/usr/lib/python2.7/pickle.py", line 858, in load
    dispatch[key](self)
  File "/usr/lib/python2.7/pickle.py", line 1133, in load_reduce
    value = func(*args)
  File "sklearn/tree/_tree.pyx", line 601, in 
sklearn.tree._tree.Tree.__cinit__
ValueError: Buffer dtype mismatch, expected 'SIZE_t' but got 'long long'

非常感谢你。 如果有人可以解决这个问题,那将会非常有用。

0 个答案:

没有答案