Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
684 views
in Technique[技术] by (71.8m points)

machine learning - Scikits-Learn RandomForrest trained on 64bit python wont open on 32bit python

I train a RandomForestRegressor model on 64bit python. I pickle the object. When trying to unpickle the object on 32bit python I get the following error:

'ValueError: Buffer dtype mismatch, expected 'SIZE_t' but got 'long long''

I really have no idea how to fix this, so any help would be hugely appreciated.

Edit: more detail

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:python27libpickle.py", line 1378, in load
    return Unpickler(file).load()
  File "c:python27libpickle.py", line 858, in load
    dispatch[key](self)
  File "c:python27libpickle.py", line 1133, in load_reduce
    value = func(*args)
  File "_tree.pyx", line 1282, in sklearn.tree._tree.Tree.__cinit__ (sklearnre
e\_tree.c:10389)
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This occurs because the random forest code uses different types for indices on 32-bit and 64-bit machines. This can, unfortunately, only be fixed by overhauling the random forests code. Since several scikit-learn devs are working on that anyway, I put it on the todo list.

For now, the training and testing machines need to have the same pointer size.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...