I found that other people have the same confusion as me. I tried some of the suggestions but they didn’t help me solve the problem, including
for child in model.children():
for ii in range(len(child)):
if type(child[ii]) == nn.BatchNorm2d:
child[ii].track_running_stats = False