ky_Pa:

        for m in self.modules():
            if isinstance(m, nn.Conv2d):
                n = m.kernel_size[0] * m.kernel_size[1] * m.planes



I think this m.planes should be either m.in_channels or m.out_channels. I’m not sure which is suitable though.