johnolafenwa:

Note that inputs.size(0) would give the total images in each batch.
Finally
epoch_loss = running_loss/num_images
epoch_acc = running_acc/num_images



what about running_loss/len(dataloader['val'].dataset) ? Its has the same effect, but more efficient in runtime.