Thanks a lot for your reply! I have corrected in_channels = 3 to in_channels = 1 and there is another error:
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-6-84df8dc8fb2f> in <module>
     14         images, labels = batch
     15 
---> 16         preds = dense_network(images) # Pass Batch
     17 
     18         loss = F.cross_entropy(preds, labels)

~\anaconda3\lib\site-packages\torch\nn\modules\module.py in __call__(self, *input, **kwargs)
    548             result = self._slow_forward(*input, **kwargs)
    549         else:
--> 550             result = self.forward(*input, **kwargs)
    551         for hook in self._forward_hooks.values():
    552             hook_result = hook(self, input, result)

<ipython-input-5-d099d05e804c> in forward(self, x)
     92 
     93         out = self.bn(out)
---> 94         out = out.view(-1, 64*4*4)
     95 
     96         out = self.pre_classifier(out)

RuntimeError: shape '[-1, 1024]' is invalid for input of size 5760