From b8134c79b34d8baf88fe0815ce6776f28f54dbfe Mon Sep 17 00:00:00 2001 From: Karthikeyan Singaravelan Date: Mon, 8 Jun 2020 16:06:33 +0000 Subject: [PATCH] Fix deprecation warnings due to invalid escape sequences. --- pretrainedmodels/models/dpn.py | 6 +++--- pretrainedmodels/models/wideresnet.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pretrainedmodels/models/dpn.py b/pretrainedmodels/models/dpn.py index bd70000..19bcd83 100644 --- a/pretrainedmodels/models/dpn.py +++ b/pretrainedmodels/models/dpn.py @@ -252,14 +252,14 @@ def __init__( self.num_1x1_c = num_1x1_c self.inc = inc self.b = b - if block_type is 'proj': + if block_type == 'proj': self.key_stride = 1 self.has_proj = True - elif block_type is 'down': + elif block_type == 'down': self.key_stride = 2 self.has_proj = True else: - assert block_type is 'normal' + assert block_type == 'normal' self.key_stride = 1 self.has_proj = False diff --git a/pretrainedmodels/models/wideresnet.py b/pretrainedmodels/models/wideresnet.py index 6300ee7..ab846ec 100644 --- a/pretrainedmodels/models/wideresnet.py +++ b/pretrainedmodels/models/wideresnet.py @@ -35,7 +35,7 @@ def group(input, params, base, stride, n): return o # determine network size by parameters - blocks = [sum([re.match('group%d.block\d+.conv0.weight'%j, k) is not None + blocks = [sum([re.match(r'group%d.block\d+.conv0.weight'%j, k) is not None for k in params.keys()]) for j in range(4)] def f(input, params, pooling_classif=True):