Yellow-Champagne:

loss = np.mean(np.array(val_loss))


looks like you didn’t cast your val_loss properly. I assume val_loss is a torch tensor - you can try loss = torch.mean(val_loss).numpy() if you get errors related to using a gpu try loss = torch.mean(val_loss).detach().cpu().numpy()