Your code works fine using this code:
x = torch.randn(1, 1, 224, 224)
output = resnet18(x)

I think you might have a typo in your shapes.
Are you using 224 or 244 as the spatial size?
Your transformation code looks fine. However, here you say your input is [batch_size, 1, 244, 244].