Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
jph00 committed May 1, 2022
1 parent 8c83203 commit 9668a5c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,14 @@

<!-- do not remove -->


## 2.6.3

### Bugs Squashed

- Fix `Learner` pickling problem introduced in v2.6.2


## 2.6.2

### Bugs Squashed
Expand Down
6 changes: 5 additions & 1 deletion fastai/learner.py
Expand Up @@ -301,6 +301,11 @@ def loss_not_reduced(self):
def to_detach(self,b,cpu=True,gather=True):
return self.dl.to_detach(b,cpu,gather) if hasattr(getattr(self,'dl',None),'to_detach') else to_detach(b,cpu,gather)

def __getstate__(self): return {k:v for k,v in self.__dict__.items() if k!='lock'}
def __setstate__(self, state):
self.__dict__.update(state)
self.lock = threading.Lock()

Learner.x,Learner.y = add_props(lambda i,x: detuplify((x.xb,x.yb)[i]))

# Cell
Expand Down Expand Up @@ -392,7 +397,6 @@ def load_learner(fname, cpu=True, pickle_module=pickle):
res.dls.cpu()
if hasattr(res, 'mixed_precision'): res = res.to_fp32()
elif hasattr(res, 'non_native_mixed_precision'): res = res.to_non_native_fp32()
res.lock = threading.Lock()
return res

# Cell
Expand Down

0 comments on commit 9668a5c

Please sign in to comment.