From d3ba34ee7e147804d694bf5955d74156105a4262 Mon Sep 17 00:00:00 2001 From: rwightman Date: Thu, 5 Sep 2019 15:47:56 -0700 Subject: [PATCH] Fix Mobilenet V3 model name for sotabench. Minor res2net cleanup. --- sotabench.py | 5 ++++- timm/models/res2net.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sotabench.py b/sotabench.py index 3a10d71d..56215cc4 100644 --- a/sotabench.py +++ b/sotabench.py @@ -1,3 +1,4 @@ +import torch from torchbench.image_classification import ImageNet from timm import create_model from timm.data import resolve_data_config, create_transform @@ -77,7 +78,7 @@ model_list = [ _entry('mixnet_m', 'MixNet-M', '1907.09595'), _entry('mixnet_s', 'MixNet-S', '1907.09595'), _entry('mnasnet_100', 'MnasNet-B1', '1807.11626'), - _entry('mobilenetv3_100', 'MobileNet V3(1.0)', '1905.02244', + _entry('mobilenetv3_100', 'MobileNet V3-Large 1.0', '1905.02244', model_desc='Trained in PyTorch with RMSProp, exponential LR decay, and hyper-params matching ' 'paper as closely as possible.'), _entry('resnet18', 'ResNet-18', '1812.01187'), @@ -216,4 +217,6 @@ for m in model_list: data_root=os.environ.get('IMAGENET_DIR', './imagenet') ) + torch.cuda.empty_cache() + diff --git a/timm/models/res2net.py b/timm/models/res2net.py index 30dffc1a..3b503e52 100644 --- a/timm/models/res2net.py +++ b/timm/models/res2net.py @@ -58,7 +58,7 @@ class Bottle2neck(nn.Module): super(Bottle2neck, self).__init__() assert dilation == 1 and previous_dilation == 1 # FIXME support dilation self.scale = scale - self.is_first = True if stride > 1 or downsample is not None else False + self.is_first = stride > 1 or downsample is not None self.num_scales = max(1, scale - 1) width = int(math.floor(planes * (base_width / 64.0))) * cardinality outplanes = planes * self.expansion