Hi,
I am training a very simple CNN. While training everything goes well, but when it comes to testing I am getting Runtime error for not having enough memory! I am new in using PyTorch! I am posting the testing portion of the code below, any help will be highly appreciated!
loss_function = nn.MSELoss()
net.eval()
Variable_store_3 = np.empty((0,1)) 
Variable_store_1 = []  
for epoch in range(1):
    running_loss = 0
    Variable_store_2 = []
    for batch in test_dataloader:
        
        x, y = batch
        outputs = net(x)
        Variable_store_1.extend(outputs)   #for plotting purposes
        Variable_store_2 .extend(y)            #for plotting purposes
        outputs_np = outputs.detach().numpy()
        Variable_store_3 = np.append(Variable_store_3, outputs_np, axis = 0)
        loss = loss_function(outputs, y)
        running_loss += loss.item() * 128  #Batch_size
        
    final_loss = math.sqrt((running_loss / len(test_dataset)))
    print(f"{epoch+1} epoch | testing loss = {final_loss}")