Thanks, I tried this code again:
images = images.unsqueeze(1).float()
outputs = model(images)

But I am getting the same error as before: “RuntimeError: Expected 4-dimensional input for 4-dimensional weight [16, 1, 5, 5], but got 3-dimensional input of size [5, 28, 28] instead”
It seems like adding the .float() is affecting the dimension of images. When I do not add the .float() and just do the .unsqueeze(1) I get the correct dimensions of [5,1,28,28], but when I add the .float() at the end I get dimensions of [5,28,28]