eval_model function results differ from test_step function. #1040
-
Hi all, From 03. PyTorch Computer Vision where we create a CNN model for FashionMNIST data - We first train and test the model using the train_step and test_step function. I understand we later run it for two epochs to begin with to get the test loss and test accuracy. After that we run the eval_model function to capture model loss and accuracy in a variable. In the video, Daniel gets the model loss and accuracy (i.e. eval_model results) same as the test_step function. But I get different results. Why is that so. What am I missing? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
FIgured it out. In my eval_model function - model_loss /= len(dataloader) should be outside the for loop. |
Beta Was this translation helpful? Give feedback.
FIgured it out. In my eval_model function -
model_loss /= len(dataloader)
model_acc /= len(dataloader)
should be outside the for loop.