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):