在 64 位 python 上训练的 Scikits-Learn RandomForrest 不会在 32 位 python 上打开 [英] Scikits-Learn RandomForrest trained on 64bit python wont open on 32bit python
问题描述
我在 64 位 python 上训练了一个 RandomForestRegressor 模型.我腌制对象.尝试在 32 位 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 不匹配,预期为 'SIZE_t' 但得到了 'long long''
'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.
更多细节
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__ (sklearn re
e\_tree.c:10389)
推荐答案
出现这种情况是因为随机森林代码在 32 位和 64 位机器上使用不同类型的索引.不幸的是,这只能通过彻底检查随机森林代码来解决.由于有几个 scikit-learn 开发人员正在致力于此,所以我把它在待办事项列表中.
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.
这篇关于在 64 位 python 上训练的 Scikits-Learn RandomForrest 不会在 32 位 python 上打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!