Solved by ptrblck in post #2 
              
              
                layer4 is an nn.Sequential module, which doesn’t have the reset_parameters method, so your conditions won’t be met. 
You could iterate all modules of layer4 and check for this attribute: 
def reset_weights(m):
    for name, layer in m.named_children():
        if name=='layer4':
            print(na…