Hi,
I want to use lists to record my accuracy and loss in order to plot them at the end. But when I add the lines for tracking the loss (I do it for training and testing) my accuracy gets worse.
This is essentially how my code looks:
train_loss_history = []
train_loss_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)

I can’t imagine how appending the values to a list can affect the training. Do you have any idea what I am missing?