Thanks for reply. Yes, you’re right. I’m trying to replace the filter kernels from the conv layer. Earlier, I had no zero padding before conv layer. This way of replacing filter kernels worked correctly. But, the error still exists even after I corrected filter kernel replacement. I don’t know, where else could be wrong. By the way, I had this AttributeError: ‘NoneType’ object has no attribute ‘data’, after running  the train for a while, like this: Epoch 1/5:   1%|          | 50/4580 [00:10<15:18,  4.93img/s, loss (batch)=0.693].  My only guess is here,         for m in self.modules():
if isinstance(m, nn.Conv2d):
nn.init.kaiming_normal(m.weight)
nn.init.constant(m.bias, 0)
I have a few exact same conv layers wrapped with nn.Sequential. I tested before, the replacement of filter kernel works.