6

I am getting this error while testing a model trained using 64-bit machine on a 32-bit raspberry pi.

This question has been asked twice years before but still is unanswered.

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

So to solve the problem If I must train the model with 32-bit then how do I create a virtual environment for it on a 64-bit machine?

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'

Thank you very much. Would be really helpful if someone can address this issue.

janu777
  • 1,940
  • 11
  • 26
  • 1
    If someone can come up with a solution that would be great. But for now, I trained the model in the raspberry pi itself and tested it. It is working fine. – janu777 Nov 21 '17 at 11:09
  • I am facing the same problem. And when I tried to train the model in the RPi then save it using pickle, I got memory error. Which method did you use to save the model? – singrium Jul 16 '18 at 09:53
  • 1
    I used joblib to dump. Check your memory first. Remove unwanted libraries if any but if you are still getting memory error, then better find a system with 32 bit. You can try AWS to get access to a 32 bit machine. – janu777 Jul 16 '18 at 12:07
  • Thank you so much, I was using pickle. But after using joblib, it worked fine. – singrium Jul 17 '18 at 09:35
  • welcome. Glad it worked :) – janu777 Jul 17 '18 at 10:23

0 Answers0