fix cnn6 blocks + eval device
Browse files- 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(
|
| 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__()
|