Solved by Mona_Jalal in post #2 
              
              
                The following is correct: 
start_time = time.time()

with torch.no_grad():

    best_network = Network()
    best_network.cuda()
    best_network.load_state_dict(torch.load('../moth_landmarks.pth')) 
    best_network.eval()
    
    batch = next(iter(train_loader))
    images, landmarks = batch['ima…