Thanks for the response. I just tried all the above suggestions and below is the full error.
Epoch 0/1
----------
tensor([[0.9929]], grad_fn=<AddmmBackward>)
  0%|                                                                                                    | 0/2 [00:01<?, ?it/s]
Traceback (most recent call last):
  File "train.py", line 16, in <module>
    train_acc_hist, train_loss_hist = train_model(resnet18, train_loader, device)
  File "/model.py", line 64, in train_model
    loss.backward()
  File "/MTL/lib/python3.7/site-packages/torch/tensor.py", line 221, in backward
    torch.autograd.backward(self, gradient, retain_graph, create_graph)
  File "/MTL/lib/python3.7/site-packages/torch/autograd/__init__.py", line 132, in backward
    allow_unreachable=True)  # allow_unreachable flag
RuntimeError: Found dtype Double but expected Float

I also printed out my input and target with their size and found this.
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([])