Skip to content

Commit

Permalink
Fix pickling
Browse files Browse the repository at this point in the history
  • Loading branch information
cancan101 committed Jan 9, 2015
1 parent 3f80b31 commit f04308c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions nolearn/lasagne.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,14 @@ def __init__(
"Use 'batch_iterator_train' and 'batch_iterator_test' instead."
)

def __getstate__(self):
ret = dict(self.__dict__)
del ret['train_iter_']
del ret['eval_iter_']
del ret['predict_iter_']

return ret

def _initialize(self):
if (getattr(self, 'train_iter_', None) is not None
and getattr(self, 'eval_iter_', None) is not None
Expand Down

0 comments on commit f04308c

Please sign in to comment.