I've trained a SVM classifier using NLTK
and svmlight
python libraries and when I call pickle.dump(my_classifier, outfile, 1)
to save my classifier, it throws this error:
File "/usr/lib/python2.7/pickle.py", line 313, in save
(t.__name__, obj))
pickle.PicklingError: Can't pickle 'PyCObject' object: <PyCObject object at 0xc1cbd50>
I read that we can't pickle a CObject
, I didn't find a solution to save my work though :/
How could I proceed? I use python 2.7.3
For what it's worth, for those who know NLTK
, everything works fine when I pickle other classifiers like MaxentClassifier
or NaiveBayesClassifier
opposed to SvmClassifier
, I think it has something to do with svmlight
library, but it's the first time I use it.