mufty:

out : tensor([[-0.6273]], grad_fn=<AddmmBackward>) torch.Size([1, 1])
target : tensor(21.1924, dtype=torch.float64) torch.Size([])
loss : tensor(476.0975, dtype=torch.float64, grad_fn=<MseLossBackward>) torch.Size([])



dtypes of your target tensor as well as the image tensor should be torch.float32. Check your Dataset.__getitem__ returns the float32 tensors.