your input size is (5,1,320,320) the model is expecting to have (5,3,320,320).
If you don’t want to pass RGB images
you can change
Conv2d(3,-,(-,-)) to Conv2d(1,-,(-,-))
if you are using a linear layer you can change
Linear(3*320*320,-) to Linear(1*320*320)
Hope this helps
With best regards,
Ranuga