Hi albanD,
Thanks for the info. I tried to copy the weights but weights are not getting copied to second model.
for m, n in zip(Model.modules(), Net.modules()):
if isinstance(m, pointwise_groupConv2d):
# Since Both Model and Net have same layers
attrs = vars(m)
attrs1 = vars(n)
#print(“Convolutional weights attributes”,m,n, m.weight.data.size(),n.weight.data.size(), attrs.keys(), attrs1.keys())
#print(m.weight.data)
n.weight.data = Remove_grouped_wt(m.weight.data, groups=2)
else:
#print("Harsha A ",m,n)
if isinstance(m, nn.Conv2d):
# copy the convolutional layer Net model weights and bias
n.weight.data = m.weight.data
#n.bias.data = m.bias.data
        elif isinstance(m, nn.BatchNorm2d):
            # copy the BatchNorm layer Net model weights and bias
            n.weight.data = m.weight.data 
            n.bias.data = m.bias.data

        elif isinstance(m, nn.Linear):
            # copy the Linear layer 
            n.weight_data = m.weight.data
            n.bias.data = m.bias.data

What is the mistake i am doing?