Hi, Juan,

It's been some time, but I  remember that I had similar issues. I think it has 
to do with the numpy arrays that specifically cause problems in pickle. 
(http://bugs.python.org/issue6784)

You could try to use joblib (which should also be more efficient):

>>> from sklearn.externals import joblib
>>> joblib.dump(clf, 'filename.pkl')
>>> clf = joblib.load('filename.pkl') 

(http://scikit-learn.org/stable/modules/model_persistence.html) 
 

Best,
Sebastian

> On Jan 22, 2015, at 8:50 AM, jni.s...@gmail.com wrote:
> 
> Hi all,
> 
> I'm working on a project that depends on sklearn. I've been up test coverage 
> (which includes saving a RandomForest, so far using joblib serialization), 
> and now I wanted to make the project Python 3-compatible. However, the final 
> roadblock is the sharing of RF objects: I can't load the Python 2-serialized 
> RFs with Python 3 tests. Of course, the test outcome depends on the exact RF 
> that was created a while back. Is there any way around this?
> 
> Thanks!
> 
> Juan.
> 
> 
> ------------------------------------------------------------------------------
> New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
> GigeNET is offering a free month of service with a new server in Ashburn.
> Choose from 2 high performing configs, both with 100TB of bandwidth.
> Higher redundancy.Lower latency.Increased capacity.Completely compliant.
> http://p.sf.net/sfu/gigenet_______________________________________________
> Scikit-learn-general mailing list
> Scikit-learn-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general


------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to