Solved by InnovArul in post #2 
              
              
                Linear layer expects a 2D tensor,  where as conv2d outputs a 4D tensor.  Try to use .view() to change 4D tensor to 2D tensor.