Tonic commited on
Commit
b3c0905
·
verified ·
1 Parent(s): 72ae1bf

fix cnn6 blocks + eval device

Browse files
Files changed (1) hide show
  1. job_train.py +3 -1
job_train.py CHANGED
@@ -72,13 +72,15 @@ def build_backbone(arch: str, pretrained: bool):
72
  import torch.nn as nn
73
  ch = (32, 64, 128, 256, 256, 512)
74
  blocks = []
 
75
  for c in ch:
76
- blocks += [nn.Conv2d(blocks[-1].out_channels if blocks else 3, c, 3, padding=1, bias=False),
77
  nn.BatchNorm2d(c), nn.ReLU(inplace=True),
78
  nn.Conv2d(c, c, 3, padding=1, groups=c, bias=False), # depthwise
79
  nn.BatchNorm2d(c), nn.ReLU(inplace=True),
80
  nn.Conv2d(c, c, 1, bias=False), nn.BatchNorm2d(c), nn.ReLU(inplace=True),
81
  nn.MaxPool2d(2)]
 
82
  class CNN6(nn.Module):
83
  def __init__(self):
84
  super().__init__()
 
72
  import torch.nn as nn
73
  ch = (32, 64, 128, 256, 256, 512)
74
  blocks = []
75
+ prev = 3
76
  for c in ch:
77
+ blocks += [nn.Conv2d(prev, c, 3, padding=1, bias=False),
78
  nn.BatchNorm2d(c), nn.ReLU(inplace=True),
79
  nn.Conv2d(c, c, 3, padding=1, groups=c, bias=False), # depthwise
80
  nn.BatchNorm2d(c), nn.ReLU(inplace=True),
81
  nn.Conv2d(c, c, 1, bias=False), nn.BatchNorm2d(c), nn.ReLU(inplace=True),
82
  nn.MaxPool2d(2)]
83
+ prev = c
84
  class CNN6(nn.Module):
85
  def __init__(self):
86
  super().__init__()