Skip to content

Commit

Permalink
Fix cb_savepath creation
Browse files Browse the repository at this point in the history
  • Loading branch information
GilesStrong committed Nov 12, 2020
1 parent 2d06d18 commit 07fef2b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

## Fixes

- `Model` now creats `cb_savepath` is it didn't already exist

## Changes

## Depreciations
Expand Down
1 change: 1 addition & 0 deletions lumin/nn/models/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ def fit(self, n_epochs:int, fy:FoldYielder, bs:int, bulk_move:bool=True, train_o
self.fit_params = FitParams(cbs=cbs, cyclic_cbs=cyclic_cbs, loss_cbs=loss_cbs, stop=False, n_epochs=n_epochs, fy=fy, val_idx=val_idx, bs=bs,
bulk_move=bulk_move, train_on_weights=train_on_weights, cb_savepath=Path(cb_savepath), loss_func=self.loss,
opt=self.opt)
self.fit_params.cb_savepath.mkdir(parents=True, exist_ok=True)
if inspect.isclass(self.fit_params.loss_func) or isinstance(self.fit_params.loss_func, partial): self.fit_params.loss_func = self.fit_params.loss_func()
self.fit_params.partial_by = partialler(BatchYielder, objective=self.objective, use_weights=self.fit_params.train_on_weights,
bulk_move=self.fit_params.bulk_move, input_mask=self.input_mask)
Expand Down

0 comments on commit 07fef2b

Please sign in to comment.