Scikits-Learn RandomForrest在64位python上受过培训,不会在32位python上打开 [英] Scikits-Learn RandomForrest trained on 64bit python wont open on 32bit python

查看:240
本文介绍了Scikits-Learn RandomForrest在64位python上受过培训,不会在32位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:缓冲区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:\python27\lib\pickle.py", line 1378, in load
    return Unpickler(file).load()
  File "c:\python27\lib\pickle.py", line 858, in load
    dispatch[key](self)
  File "c:\python27\lib\pickle.py", line 1133, in load_reduce
    value = func(*args)
  File "_tree.pyx", line 1282, in sklearn.tree._tree.Tree.__cinit__ (sklearn\tre
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.

这篇关于Scikits-Learn RandomForrest在64位python上受过培训,不会在32位python上打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆