cPickle:SystemError: error return without exception set
Asked Answered
S

1

6

While dumping large matrix (170000*20000) as follows

 cPickle.dump(train_set,gzip.open('train.pickle.gz','wb'), cPickle.HIGHEST_PROTOCOL)

I get following error:

SystemError: error return without exception set

How would I deal in this case?

Superstructure answered 8/1, 2016 at 16:13 Comment(0)
T
5

cPickle can't be used for storing very large objects ( see http://bugs.python.org/issue11564 ).

You have several options:

  • split the data into chunks and store it in multiple files
  • numpy.save
  • h5py <- my favorite because of its convenient numpy-like interface, plus the data are stored in hdf5 which enables interopability with other software/languages.
  • pytables
Topliffe answered 7/7, 2016 at 12:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.