model=Net()
optimizer1=torch.optim.SGD(model.features.parameters(),lr=0.1,momentum=0.9,dampening=0.9)
scheduler = torch.optim.lr_scheduler.ExponentialLR(optimizer1,
                                                       gamma=0.999,
                                                       last_epoch=100)

Afther runing, a error is shown like this:>---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
 in ()
3 scheduler = torch.optim.lr_scheduler.ExponentialLR(optimizer1,
4                                                        gamma=0.999,
----> 5                                                        last_epoch=100)
~/anaconda3/envs/pytorch4/lib/python3.6/site-packages/torch/optim/lr_scheduler.py in init(self, optimizer, gamma, last_epoch)
180     def init(self, optimizer, gamma, last_epoch=-1):
181         self.gamma = gamma
–> 182         super(ExponentialLR, self).init(optimizer, last_epoch)
183
184     def get_lr(self):
~/anaconda3/envs/pytorch4/lib/python3.6/site-packages/torch/optim/lr_scheduler.py in init(self, optimizer, last_epoch)
18                 if ‘initial_lr’ not in group:
19                     raise KeyError("param ‘initial_lr’ is not specified "
—> 20                                    “in param_groups[{}] when resuming an optimizer”.format(i))
21         self.base_lrs = list(map(lambda group: group[‘initial_lr’], optimizer.param_groups))
22         self.step(last_epoch + 1)
KeyError: “param ‘initial_lr’ is not specified in param_groups[0] when resuming an optimizer”