pickle.dump(model, open(sys.argv[1], ‘wb’))
SystemError: error return without exception set

The error can be reproduced by the following code:
python2.7 -c “import cPickle; cPickle.dumps(‘\x00’ * 2**31)”

Changing cPickle to pickle may solve this problem if you do not care about the efficiency issue of pickle. To completely solve the issue, you need to switch to Python 3. Using numpy.save/HDF5 maybe good choices too.

Advertisements