When you call .eval() on a model… it’s telling the model it is not going to be training anymore… as I understand anyway.
I am not sure you can switch from train mode to eval mode like your code is demonstrating… and I’d follow the lead of most examples and separate the two loops entirely into separate files