Pickling errors when saving
I'm seeing errors when trying to save the result. I think this is due to attempting to pickle Dynesty
objects.
Trace below.
This only occurs for me when using python2
.
I think the solution for this will be to write more sophisticated post-processing.
20:50 INFO : Saving result to outdir/BasicTutorial_result.h5
Traceback (most recent call last):
File "tutorials/BasicTutorial.py", line 57, in <module>
injection_parameters=injection_parameters, outdir=outdir, label='BasicTutorial')
File "/Users/ctal0001/anaconda2/lib/python2.7/site-packages/tupak/sampler.py", line 405, in run_sampler
result.save_to_file(outdir=outdir, label=label)
File "/Users/ctal0001/anaconda2/lib/python2.7/site-packages/tupak/result.py", line 40, in save_to_file
deepdish.io.save(file_name, self)
File "/Users/ctal0001/anaconda2/lib/python2.7/site-packages/deepdish/io/hdf5io.py", line 596, in save
filters=filters, idtable=idtable)
File "/Users/ctal0001/anaconda2/lib/python2.7/site-packages/deepdish/io/hdf5io.py", line 212, in _save_level
idtable=idtable)
File "/Users/ctal0001/anaconda2/lib/python2.7/site-packages/deepdish/io/hdf5io.py", line 212, in _save_level
idtable=idtable)
File "/Users/ctal0001/anaconda2/lib/python2.7/site-packages/deepdish/io/hdf5io.py", line 304, in _save_level
_save_pickled(handler, group, level, name=name)
File "/Users/ctal0001/anaconda2/lib/python2.7/site-packages/deepdish/io/hdf5io.py", line 172, in _save_pickled
node.append(level)
File "/Users/ctal0001/anaconda2/lib/python2.7/site-packages/tables/vlarray.py", line 519, in append
sequence = atom.toarray(sequence)
File "/Users/ctal0001/anaconda2/lib/python2.7/site-packages/tables/atom.py", line 1086, in toarray
buffer_ = self._tobuffer(object_)
File "/Users/ctal0001/anaconda2/lib/python2.7/site-packages/tables/atom.py", line 1220, in _tobuffer
return six.moves.cPickle.dumps(object_, six.moves.cPickle.HIGHEST_PROTOCOL)
cPickle.PicklingError: Can't pickle <type 'instancemethod'>: attribute lookup __builtin__.instancemethod failed