Does tracking the loss via lists affect the training?
I wanted to plot the loss of my CNN, so created lists before starting to train with
test_loss_history = [] train_loss_history = [] and added the values after every epoch with train_loss_history.append(train_loss) test_loss_history.append(test_loss). I had done the same the same with the accuracy before, but when I add these lines for the loss, the accuracy drops around 40%. Does storing values affect the training process in any way?

I am using Google Colab and train a ResNet18 with a subset of MNIST.

My code looks like that:

    train_loss_history = []
    train_acc_history = []
   for epoch in range(epoch_resume, opt.max_epochs):
       ...
       for i, data in enumerate(trainloader, 0):
          train_loss     += imgs.size(0)*criterion(logits, labels).data
          ...
       train_loss     /= len(trainset)
       train_acc_history.append(train_acc)
       train_loss_history.append(train_loss)


You can just use Tensorboard to plot loss and other metrics that you want to keep track of. Just you tensorboard default callback.

No need to saves metrics when tensorboard got your back
