Error pickling MockClassifierData
In trying to use MockClassifierData in idq-stream
, the initial lookback fails in batch.train
because PickleReporter
will try to pickle MockClassifierData
before starting to acquire data but fails because it can't pickle instance method objects. The (trimmed) traceback is shown below:
2018-09-24 12:05:28,207 | chunk_8-train : INFO : classifier_data -> flavor:MockClassifierData config:mockclassifierdata.ini ignore_segdb:True time:time significance:snr
2018-09-24 12:05:28,218 | chunk_8-stream : ERROR : initial training job failed!
2018-09-24 12:05:28,224 | chunk_8-stream : ERROR : Traceback (most recent call last):
File "/home/patrick.godwin/local/master/iDQ/bin/idq-stream", line 56, in <module>
stream.stream(config_path, gps_start=gps_start, gps_end=gps_end, **vars(opts))
File "/home/patrick.godwin/local/master/iDQ/lib/python2.7/site-packages/idq/stream.py", line 105, in stream
batch.train(gps_start-initial_lookback, gps_start, config_path, verbose=verbose) ### FIXME: this may not block if workflow==condor
File "/home/patrick.godwin/local/master/iDQ/lib/python2.7/site-packages/idq/batch.py", line 468, in train
path = picklereporter.report('classifierData', classifier_data)
File "/home/patrick.godwin/local/master/iDQ/lib/python2.7/site-packages/idq/io.py", line 1311, in report
pickle.dump(obj, file_obj)
File "/usr/lib64/python2.7/pickle.py", line 1370, in dump
Pickler(file, protocol).dump(obj)
...
...
File "/usr/lib64/python2.7/copy_reg.py", line 70, in _reduce_ex
raise TypeError, "can't pickle %s objects" % base.__name__
TypeError: can't pickle instancemethod objects