which version of pytorch are you using?
In the version I am using (0.4.0), the optimizers do not accept the parameters with requires_grad=False. We have to manually filter out the params before passing it to the optimizer.

  
      github.com/pytorch/pytorch
  
  
    



Issue: Allow optimizers to skip nn.Parameters that have requires_grad=False 23


	
	opened by alykhantejani
	on 2017-02-02
	
	
	closed by apaszke
	on 2017-02-03
	


I am trying to implement a gaussian blur as a convolution layer in a network, where the weights do not change....




  
  
    
    
  
  


You can either do this in your code:
optimizer = torch.optim.RSMprop(filter(lambda p: p.requires_grad, model.parameters()), lr=args.lr, momentum=args.momentum, weight_decay = args.weight.decay)
or update the pytorch version.