Does training = true in the resnet blocks break the code?

I compared the summary of the ResNet50 model that we created and the pretrained model and don’t see any difference in the number of trainable parameters. But then I took a look at the resnet50 function and noticed that it does not pass the training parameter to any of the instances of the identity block or conv block. But the definitions of those functions set training = True. So what I then did was change the definitions of those functions to set the default value of training to False. When I do that, your two predict calls produce the same results. I think the conclusion is that the batch normalization layers are updating their parameters as you run predict. Note that the parameters of the BatchNorm layers evidently don’t count as “trainable parameters” according to whatever metric the summary method uses. But they evidently are changing. We can conjecture that the pretrained model sets training = False in the declarations of the identity and conv blocks. So now the question is whether it is a bug that the notebook version sets it to True.