Dean commited on
Commit
0b86a0a
1 Parent(s): 34a1202

Training stage seems to work, creating a non-run commit to use colab as an orchestration machine

Browse files
Files changed (2) hide show
  1. dvc.yaml +7 -0
  2. src/code/training.py +3 -3
dvc.yaml CHANGED
@@ -8,3 +8,10 @@ stages:
8
  - src/data/raw/splits.mat
9
  outs:
10
  - src/data/processed/
 
 
 
 
 
 
 
 
8
  - src/data/raw/splits.mat
9
  outs:
10
  - src/data/processed/
11
+ train:
12
+ cmd: python3 src/code/training.py src/data/processed src/models
13
+ deps:
14
+ - src/code/training.py
15
+ - src/data/processed/
16
+ outs:
17
+ - src/models/
src/code/training.py CHANGED
@@ -13,13 +13,13 @@ def get_y_fn(x):
13
 
14
  def create_data(data_path):
15
  fnames = get_files(data_path/'train', extensions='.jpg')
16
- data = SegmentationDataLoaders.from_label_func(data_path/'train', bs=1, num_workers=0, fnames=fnames, label_func=get_y_fn)
17
  return data
18
 
19
 
20
  def train(data):
21
- learner = unet_learner(data, resnet34, metrics=rmse, wd=1e-2, n_out=1, loss_func=torch.nn.SmoothL1Loss())
22
- learner.fine_tune(8)
23
 
24
 
25
  if __name__ == "__main__":
 
13
 
14
  def create_data(data_path):
15
  fnames = get_files(data_path/'train', extensions='.jpg')
16
+ data = SegmentationDataLoaders.from_label_func(data_path/'train', bs=4, num_workers=0, fnames=fnames, label_func=get_y_fn)
17
  return data
18
 
19
 
20
  def train(data):
21
+ learner = unet_learner(data, resnet34, metrics=rmse, wd=1e-2, n_out=1, loss_func=MSELossFlat())
22
+ learner.fine_tune(1)
23
 
24
 
25
  if __name__ == "__main__":