You are assigning the modules directly first (e.g. via self.bn1 = nn.BatchNorm2d(in_channels)) and later again in the self.block nn.ModuleList. Since you are only using self.block, you could remove the self.bn1 = ... assignments, use an assignment without the self keyword  (bn1 = ...), and add these layers to self.block afterwards.