Solved by omarfoq in post #2 
              
              
                Hi, 
You should change your function train. If you have an issue doing this, please share your train function, and we can adapt it to do evaluation after few batches, in all cases I think you train function look like 
def train(scheduler, optimizer):
    for x, y in train_loader:
        x = x.to(de…