Well in that case you are running on GPU, can you check that the batch size for test is not very small, also the operation you do to stack predictions is not “optimal”, because you keep copying small chunks of information from GPU to CPU, probably it’s better to keep all prediction on GPU, and at the end send everything to CPU.



 pavs:

predlist=torch.cat([predlist,y_pred_targets.view(-1).cpu()])

            lbllist=torch.cat([lbllist,test_batch_labels.view(-1).cpu()])