diff --git a/models.py b/models.py index 6b71989a..b1717d99 100755 --- a/models.py +++ b/models.py @@ -45,8 +45,7 @@ def create_modules(module_defs): modules.add_module('maxpool_%d' % i, maxpool) elif module_def['type'] == 'upsample': - # upsample = nn.Upsample(scale_factor=int(module_def['stride']), mode='nearest') # WARNING: deprecated - upsample = Upsample(scale_factor=int(module_def['stride'])) + upsample = nn.Upsample(scale_factor=int(module_def['stride']), mode='nearest') modules.add_module('upsample_%d' % i, upsample) elif module_def['type'] == 'route': @@ -87,18 +86,6 @@ class EmptyLayer(nn.Module): return x -class Upsample(nn.Module): - # Custom Upsample layer (nn.Upsample gives deprecated warning message) - - def __init__(self, scale_factor=1, mode='nearest'): - super(Upsample, self).__init__() - self.scale_factor = scale_factor - self.mode = mode - - def forward(self, x): - return F.interpolate(x, scale_factor=self.scale_factor, mode=self.mode) - - class YOLOLayer(nn.Module): def __init__(self, anchors, nc, img_size, yolo_index): super(YOLOLayer, self).__init__() diff --git a/train.py b/train.py index b318331c..b5dbd857 100644 --- a/train.py +++ b/train.py @@ -12,6 +12,7 @@ from utils.datasets import * from utils.utils import * # 0.149 0.241 0.126 0.156 6.85 1.008 1.421 0.07989 16.94 6.215 10.61 4.272 0.251 0.001 -4 0.9 0.0005 320 64-1 giou +# 0.111 0.27 0.132 0.131 3.96 1.276 0.3156 0.1425 21.21 6.224 11.59 8.83 0.376 0.001 -4 0.9 0.0005 hyp = {'giou': 1.008, # giou loss gain 'xy': 1.421, # xy loss gain 'wh': 0.07989, # wh loss gain