Solved by albanD in post #2 
              
              
                Hi, 
This is because you have slic1 both in self. and self.layers. 
If you only want it in self.layers, you should not create it as an attribute of self: 
slic1=nn.Sequential()
slic1.add_module('conv1', nn.Conv2d(3, 6, 7,padding=3))
        
self.layers = nn.Sequential()
self.layers.add_module('slic…