I wanted to add a new conv layer in middle of resnet50 I was able to add it and also I was able to get inference from the new model but the problem is that I initialized the weights of the new layer to ones so that there is no difference between the output of the new and the original model. Kernel size, weight every thing is 1 and bias is also 0.
I checked the output of both the new and the original models before the layer I have added in the new model and both outputs are same.
But when I passed that output to the new layer they became different. I am not sure why and not able to rectify the error.
I also created a new layer similar to the one that I added in the model with all same attributes and initializations and passed that output to this layer and then it remained same.
I am not able to understand why this is not happening in the model. Outside the model it is working fine.
Could anyone please help me with this