Skip to content

Commit d72ac0d

Browse files
committed
Fix #173, lr cycle default 0 vs 1. Fix #177, mirror resnest weights for future stability.
1 parent 24e7535 commit d72ac0d

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

timm/models/resnest.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,21 @@ def _cfg(url='', **kwargs):
3636
'resnest26d': _cfg(
3737
url='https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/gluon_resnest26-50eb607c.pth'),
3838
'resnest50d': _cfg(
39-
url='https://hangzh.s3.amazonaws.com/encoding/models/resnest50-528c19ca.pth'),
39+
url='https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-resnest/resnest50-528c19ca.pth'),
4040
'resnest101e': _cfg(
41-
url='https://hangzh.s3.amazonaws.com/encoding/models/resnest101-22405ba7.pth',
41+
url='https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-resnest/resnest101-22405ba7.pth',
4242
input_size=(3, 256, 256), pool_size=(8, 8)),
4343
'resnest200e': _cfg(
44-
url='https://hangzh.s3.amazonaws.com/encoding/models/resnest200-75117900.pth',
44+
url='https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-resnest/resnest200-75117900.pth',
4545
input_size=(3, 320, 320), pool_size=(10, 10), crop_pct=0.909, interpolation='bicubic'),
4646
'resnest269e': _cfg(
47-
url='https://hangzh.s3.amazonaws.com/encoding/models/resnest269-0cc87c48.pth',
47+
url='https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-resnest/resnest269-0cc87c48.pth',
4848
input_size=(3, 416, 416), pool_size=(13, 13), crop_pct=0.928, interpolation='bicubic'),
4949
'resnest50d_4s2x40d': _cfg(
50-
url='https://hangzh.s3.amazonaws.com/encoding/models/resnest50_fast_4s2x40d-41d14ed0.pth',
50+
url='https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-resnest/resnest50_fast_4s2x40d-41d14ed0.pth',
5151
interpolation='bicubic'),
5252
'resnest50d_1s4x24d': _cfg(
53-
url='https://hangzh.s3.amazonaws.com/encoding/models/resnest50_fast_1s4x24d-d4a4f76f.pth',
53+
url='https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-resnest/resnest50_fast_1s4x24d-d4a4f76f.pth',
5454
interpolation='bicubic')
5555
}
5656

timm/scheduler/cosine_lr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def get_update_values(self, num_updates: int):
103103
def get_cycle_length(self, cycles=0):
104104
if not cycles:
105105
cycles = self.cycle_limit
106-
assert cycles > 0
106+
cycles = max(1, cycles)
107107
if self.t_mul == 1.0:
108108
return self.t_initial * cycles
109109
else:

timm/scheduler/scheduler_factory.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def create_scheduler(args, optimizer):
2828
decay_rate=args.decay_rate,
2929
warmup_lr_init=args.warmup_lr,
3030
warmup_t=args.warmup_epochs,
31-
cycle_limit=getattr(args, 'lr_cycle_limit', 0),
31+
cycle_limit=getattr(args, 'lr_cycle_limit', 1),
3232
t_in_epochs=True,
3333
noise_range_t=noise_range,
3434
noise_pct=getattr(args, 'lr_noise_pct', 0.67),
@@ -44,7 +44,7 @@ def create_scheduler(args, optimizer):
4444
lr_min=args.min_lr,
4545
warmup_lr_init=args.warmup_lr,
4646
warmup_t=args.warmup_epochs,
47-
cycle_limit=getattr(args, 'lr_cycle_limit', 0),
47+
cycle_limit=getattr(args, 'lr_cycle_limit', 1),
4848
t_in_epochs=True,
4949
noise_range_t=noise_range,
5050
noise_pct=getattr(args, 'lr_noise_pct', 0.67),

timm/scheduler/tanh_lr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def get_update_values(self, num_updates: int):
107107
def get_cycle_length(self, cycles=0):
108108
if not cycles:
109109
cycles = self.cycle_limit
110-
assert cycles > 0
110+
cycles = max(1, cycles)
111111
if self.t_mul == 1.0:
112112
return self.t_initial * cycles
113113
else:

0 commit comments

Comments
 (0)